Guides / WordPress, for developers

Spectare for WordPress

The plugin supports two personalisation methods. Slots fill content client-side after page load and work with any caching plugin. Zones render content server-side before the page is sent, with no shimmer and no caching conflicts.

This page covers installation and rendering setup. If you are writing or reviewing the content itself, see the WordPress guide for marketers. To bring an existing site’s pages in as a starting content library, see importing your existing content.

Slots vs zones: which to use

Slots

Client-side, works everywhere

  • +No API key required
  • +Compatible with all caching plugins
  • +Works in page builders and classic editor
  • -Brief shimmer while JS runs
  • -Not indexed by search engines

Use for blog sidebars, WooCommerce pages, or any site where disabling page caching is not practical.

Zones

Server-rendered, no shimmer

  • +Content in HTML at first paint
  • +SEO-indexable content
  • +Page caching bypassed automatically
  • -Requires an API key
  • -Adds server response time on cold cache

Use for marketing pages and landing pages where first-paint quality matters and you can accept a slightly slower uncached load.

Slots and zones are independent methods that work alongside each other, not an either/or choice. Slots fill client-side after the page loads; zones render on the server before the page is sent. Most sites use one method per page, matched to the page: zones on marketing and landing pages where first paint and SEO matter, slots on cached pages, blog templates, and sidebars where you would rather not disable page caching or manage an API key. You can also combine them on a single page, for example a zone hero with slots further down.

Installing the plugin

One plugin covers both methods. The API key is only required if you use zones.

Download and activate the plugin

Enter your workspace slug

Settings, Spectare

Add your API key

zones only

Add a slot or zone block

in the Gutenberg editor

The API key step is only needed if you plan to use zones.

  1. 01

    Download the plugin

    Download the spectare-personalisation.zip file from the homepage or your Spectare account.

  2. 02

    Upload and activate

    In your WordPress admin, go to Plugins, then Add New, then Upload Plugin. Choose the zip file, install it, and activate it.

  3. 03

    Enter your workspace slug

    Go to Settings, then Spectare. Enter your workspace slug, the short identifier for your organisation, visible in your Spectare admin URL and on the Settings page.

  4. 04

    Add your API key (zones only)

    If you plan to use server-rendered zones, copy your API key from Spectare admin under Settings. Paste it into the API key field in Settings, Spectare. Leave blank if you are only using slots.

  5. 05

    Add a slot or zone to a page

    Open any page in the Gutenberg editor. Search for "Spectare Slot" or "Spectare Zone" in the block inserter. Drag it onto the page, choose your slot name or zone, and publish.

Method A: Slots

Slots are filled by spectare.js after page load. Use the Gutenberg block or shortcodes.

Gutenberg block

Search for Spectare Slot in the block inserter. Choose a slot name in the block settings panel. The three below are the common ones; the block also offers two extra supporting slots and a custom name for additional placements. Optionally set a reserved height to prevent layout shift while content loads.

primary

Main content block. Place above the fold or at the top of your content area.

supporting

Secondary block. Place in the middle of the page or alongside the primary slot.

secondary

Third block. Use for a CTA area, sidebar, or bottom of page.

Shortcodes

[spectare_slot name="primary"]
[spectare_slot name="supporting"]
[spectare_slot name="secondary"]

Reserving height to prevent layout shift

The height parameter reserves vertical space before content loads. Value is in pixels. 200 is a sensible default for a feature card.

[spectare_slot name="primary" height="200"]

Method B: Zones

Zones are rendered server-side by the PHP plugin before the page is sent. Requires an API key. Page caching is bypassed automatically on any page that contains a zone.

Gutenberg block

Search for Spectare Zone in the block inserter. Choose a zone in the block settings panel. Each zone renders component types matched to its position on the page.

hero

Hero banners and image overlays. Above-fold position.

HeroStatement, ImageCtaHero

body

Feature cards, stats, code blocks, comparison tables.

AtomCard, StatGrid, CodeBlock, FeatureList, ComparisonTable

proof

Social proof and case studies.

TestimonialCard

cta

Call-to-action strips.

CtaStrip

Shortcodes

[spectare_zone zone="hero"]
[spectare_zone zone="body"]
[spectare_zone zone="proof"]
[spectare_zone zone="cta"]

How caching is handled

Any page containing a [spectare_zone] shortcode or zone block sets the DONOTCACHEPAGE constant and sends Cache-Control: no-store headers. All major caching plugins (WP Rocket, W3 Total Cache, WP Super Cache, LiteSpeed Cache) recognise this constant and skip caching for that page. No manual cache configuration is needed.

Cold cache load time

On the first uncached request, the plugin calls the Spectare API to classify the visitor and assemble content. This adds 2 to 8 seconds to the server response time for that visitor. Subsequent visitors with the same intent pattern (same UTM source, medium, and campaign) hit the Spectare assembly cache and receive content in under 100ms. For key landing pages, you can warm the cache by visiting the page with representative UTM parameters before your campaign goes live.

Page builders

All shortcodes work in any page builder via an HTML or Code element. Zone shortcodes work the same way as slot shortcodes.

Elementor

Add an HTML widget. Paste the shortcode inside it.

Divi

Add a Code module. Paste the shortcode inside it.

Beaver Builder

Add an HTML module. Paste the shortcode inside it.

WPBakery

Add a Raw HTML element. Paste the shortcode inside it.

Bricks Builder

Add a Code element. Paste the shortcode inside it.

Classic editor

Switch to the Text tab and paste the shortcode where you want it to appear.

Without the plugin

If you prefer not to use the plugin, add the script tag manually and place data-spectare-slot divs in your templates. Zones require the plugin since they need server-side PHP execution.

<script
  src="https://spectare.ai/spectare.js"
  data-org="YOUR_WORKSPACE_SLUG"
  data-base-url="https://spectare.ai"
></script>

Caching plugin compatibility

Slots fill via JavaScript after the cached HTML page loads, so page caching does not affect them. Zones bypass page caching automatically via DONOTCACHEPAGE.

WP Rocket

Slots: CompatibleZones: Bypassed automatically

Slots: Works out of the box. If you have JS delay enabled, add spectare.js to the excluded files list under Settings, File Optimisation, Delay JavaScript Execution.

Zones: Zone pages set DONOTCACHEPAGE so WP Rocket skips them. No configuration needed.

W3 Total Cache

Slots: CompatibleZones: Bypassed automatically

Slots: Page caching does not affect slots. If you use JS minification, exclude spectare.js from the minify list.

Zones: Zone pages set DONOTCACHEPAGE. W3 Total Cache respects this constant automatically.

WP Super Cache

Slots: CompatibleZones: Bypassed automatically

Slots: No configuration needed. Slots fill after the cached HTML page loads.

Zones: Zone pages set DONOTCACHEPAGE and nocache headers. WP Super Cache skips these pages.

LiteSpeed Cache

Slots: CompatibleZones: Bypassed automatically

Slots: Works without configuration. If you use JS defer, add spectare.js to the JS Defer Excludes list.

Zones: Zone pages set DONOTCACHEPAGE. LiteSpeed Cache honours this constant.

Cloudflare Rocket Loader

Slots: CompatibleZones: Not applicable

Slots: If you see empty slots, add spectare.js to the Rocket Loader exclusion list in your Cloudflare dashboard under Speed, Optimisation.

Zones: Zone rendering is server-side and is unaffected by Rocket Loader.

Autoptimize

Slots: CompatibleZones: Not applicable

Slots: Exclude spectare.js from JS optimisation via the "Exclude scripts from Autoptimize" field.

Zones: Zone rendering is server-side. Autoptimize JS handling does not apply.

Troubleshooting

Slots appear empty after page load

Check that spectare.js is not being deferred or blocked by your caching plugin. Open browser DevTools, go to the Network tab, and confirm spectare.js loads with a 200 status. Also confirm your workspace slug is correctly entered in Settings, Spectare.

Empty slots with Cloudflare Rocket Loader enabled

Add spectare.js to the Rocket Loader exclusion list. In your Cloudflare dashboard, go to Speed, Optimisation, and find the Rocket Loader exclusion field. Add the full script URL: https://spectare.ai/spectare.js.

Slot pages jump when content fills in

Add the height parameter to your shortcode: [spectare_slot name="primary" height="200"]. This reserves vertical space before content loads so the layout does not shift.

Zone pages return a blank area or no content

Check that your API key is entered correctly in Settings, Spectare. The key starts with sk_. Then check the base URL field: it should be https://spectare.ai (or your custom domain if self-hosted). Open your browser network tools and look for a failed request to /api/assemble/ssr.

Zone pages are slow to load

The first uncached request calls the Spectare API and can take 2 to 8 seconds. Subsequent requests with the same UTM pattern use the assembly cache and load in under 100ms. Warm the cache before campaigns go live by visiting the page with representative UTM parameters.

Zone pages are being cached by my caching plugin

The plugin sets DONOTCACHEPAGE and Cache-Control: no-store headers automatically. If your caching plugin is still caching these pages, check that the plugin supports the DONOTCACHEPAGE constant (all major plugins do). As a fallback, add the page URL to your caching plugin's excluded pages list.

Content does not change between visits

Spectare assembles content based on visitor signals. If there are no UTM parameters, referrer, or page context signals, the same default content appears. Add UTM parameters to your campaign links to give Spectare stronger intent signals.

Need help with your setup?

Email us at [email protected] and we will help you get Spectare working on your site.