Features

Bot-fighting AJAX mode

Published · Last updated

Bot-fighting AJAX keeps indexable filter pages on real URLs while moving non-indexable filter state into a browser-side #ssf= fragment. Direct requests for deep, non-indexable combinations are redirected before normal WordPress plugins load, while human visitors still see the exact products and filters they selected.

Available since 6.52.30.

Bot-fighting AJAX is how filters load on every site, in Super Speedy Filters and Super Speedy Filters Lite.

Before you enable it

Bot-fighting AJAX uses your filter indexing rules to decide which URLs are permitted as normal documents. Configure those rules first. You also need a page cache or CDN configured to cache your shop, product category and other indexable taxonomy archives.

Check Bot-fighting AJAX is running

  1. Go to Super Speedy > Filters > Main.
  2. Filter loading says Bot-fighting AJAX. If it says Full page loading, see Filters reload the whole page under Troubleshooting.
  3. Under While filters restore from a #ssf= link, select Hide the grid and filters, show a spinner (recommended).
  4. Choose how the filters and products look while a click loads under Filters AJAX transition and Products AJAX transition.
  5. Save, then confirm the status reports Fragment AJAX mu-plugin installed. If it does not, see The must-use plugin is not installed.

The other AJAX checkbox

Fast page AJAX (mu-plugin) is separate and optional. Bot-fighting AJAX does not require it.

When enabled, it trims the plugins that load for the product-update POST to WooCommerce, Super Speedy Filters and plugins allowed by its compatibility settings. WordPress then loads and handles the request as normal, without the trimmed plugins. This can make the response faster, but test integrations that alter product queries, prices or archive output. Lazy widget fragment cache hits are answered early, before WordPress loads, whatever this setting says.

What happens when a shopper filters

  1. The shopper changes a filter.
  2. Super Speedy Filters sends one marked AJAX POST. Its response contains the products, filters and visible archive content needed to update the page.
  3. The server classifies the state using the same rules used for filter indexing.
  4. An indexable state keeps its real filter URL.
  5. A non-indexable state keeps the nearest permitted archive URL and stores the full filter state after #ssf=.
  6. The History API preserves back, forward, bookmarked and shared navigation without a full page refresh.

The product update does not make another page-level GET. Cacheable fragment GETs are used only when a configured lazy filter widget is opened, hovered or triggered by its selected loading event.

How #ssf= works in browsers

Consider this address:

https://example.com/product-category/shoes/#ssf=brand/acme/colour/black/

The part after # is a URL fragment. Browsers do not include it in the HTTP request, so the server receives only:

https://example.com/product-category/shoes/

That ordinary taxonomy archive can be served by your page cache or CDN. After it loads, Super Speedy Filters reads the fragment in the browser and restores the requested state through the marked AJAX POST.

Current Chrome, Firefox, Safari and Edge releases, including mobile versions, implement URL fragments and the History API in the same way. The state does not depend on a cookie or local storage, so the address can be bookmarked or shared. Back and forward navigation restore it too. With JavaScript disabled, the permitted landing archive remains visible but the fragment state is not restored.

Indexable and non-indexable requests

RequestResult
Indexable filter documentIts real URL remains a normal document that can be indexed and cached.
Shopper selects a non-indexable combinationThe address uses the nearest permitted archive plus #ssf= state and updates through AJAX.
Bot or visitor requests a non-indexable URL directlyThe early gate permanently redirects to the nearest permitted archive plus the original #ssf= state before normal plugins load.
Marked Super Speedy Filters AJAX POSTThe request is answered normally so the interface can return the chosen products and filters.
Admin, REST API, cron, login and unrelated requestsThe archive gate leaves them alone.

The permitted destination may be the shop, a product category or another indexable taxonomy archive. Your indexing policy chooses it rather than always sending visitors to the shop.

Why this reduces bot load

A crawler can discover or invent huge numbers of filter URLs. Without the early gate, each request can start WordPress, WooCommerce, the theme and other plugins before the response decides that the document should not be indexed.

With Bot-fighting AJAX, the must-use plugin reads the compiled indexing policy before normal plugins load. Without the must-use plugin, Super Speedy Filters gives the same redirect itself once WordPress has loaded, which costs more per bot request but still keeps deep filter documents out of search engines and off your server’s rendering work. It redirects a non-indexable document request immediately to a normal, indexable archive that your page cache or CDN can serve. The original state sits after #, so it is not sent back as part of the archive request.

This prevents an ordinary crawler from repeatedly making WordPress build deep filter documents. Super Speedy Filters does not provide the page cache itself, so a cold archive request can still reach WordPress until your cache has warmed it.

This is not a firewall. A scraper that deliberately behaves like a shopper and submits the marked AJAX interaction can still make application requests. Keep suitable rate limiting and the other bot controls for your store.

URL fragments and widget fragments are different

  • A URL fragment is the #ssf= state in the browser address. It is never part of the HTTP request.
  • A widget fragment is a small HTML response containing a delayed filter widget. It is requested only when that lazy widget is needed.

Widget fragments use public, cacheable GET endpoints. Static fragments are shared wherever their output is the same. Dynamic fragments include the relevant filter state. Responses carry public cache headers, a noindex, nofollow robots header and an X-SSF-Fragment-Cache header showing HIT or MISS.

The widget fragment URL contains a cache generation. When relevant settings or data change, Super Speedy Filters advances the generation, so browsers and CDNs request a new URL instead of reusing old HTML. Requests for stale generations receive a gone response.

Choose the restore display

OptionBehaviour
Hide the grid and filters, show a spinner (recommended)Prevents a flash of the unfiltered archive and shows that restoration is in progress.
Hide the grid and filters, no spinnerPrevents the flash but leaves the content area blank during restoration.
Show the landing page, then swapDisplays the cached archive immediately, then replaces it with the filtered state. This can visibly change the content.

The spinner option is the safest default because it avoids showing products that do not match the shared or bookmarked state.

Test the setup

On staging:

  1. Open an indexable combination and confirm its real URL remains in the address bar.
  2. Open a combination beyond your indexing limits and confirm the address uses a permitted archive plus #ssf=.
  3. Copy that address into a private window. Confirm the cached archive loads and the chosen filters restore.
  4. Test the browser back and forward buttons.
  5. Request the original non-indexable document URL directly and confirm it redirects to the permitted archive.
  6. Open a lazy filter widget twice and inspect X-SSF-Fragment-Cache for the expected MISS, then HIT.

Troubleshooting

Filters reload the whole page

Bot-fighting AJAX works with every permalink structure. On Plain permalinks the address keeps the archive’s own query, such as /?product_cat=women#ssf=/?product_cat=women&pa_colour=17. If Filter loading says Full page loading, the Bot-fighting AJAX add-on is not loaded: check Super Speedy > Filters > Add-ons, and that your browser console shows no JavaScript errors.

The must-use plugin is not installed

Bot-fighting AJAX still works: Super Speedy Filters redirects the bot requests itself, after WordPress has loaded, and an admin notice says the must-use plugin is missing. For the faster early redirect, make wp-content/mu-plugins writable by PHP, then save the settings again. Do not copy an old handler into the directory because it must match the installed plugin version.

A shared link briefly shows the landing archive

Select Hide the grid and filters, show a spinner (recommended).

AJAX output misses another plugin’s changes

If Fast page AJAX (mu-plugin) is enabled, confirm the integration is included in its compatibility settings. That optional setting controls which plugins load for product-update POSTs.

The redirect destination misses the page cache

Check the page-cache or CDN rules for the destination shop or taxonomy archive. Super Speedy Filters chooses the destination but does not operate the full-page cache.

Further reading

complementary response headers, gone responses, archive reports and firewall controls
general filter and theme integration checks

Comments