How-to
Configure AJAX Selectors
Map product grid, product item, pagination, result count, and sorting selectors for custom WooCommerce themes.
When to use this
Use this when filtering updates the products but some part of the page does not — pagination stays stale, the result count is wrong, or the sort control is lost. This usually means the theme uses custom markup that the default selectors miss.
Before you start
- You have a working filter that updates products.
- You can inspect the storefront markup, or you know the theme's product loop
classes.
Default selectors
Start with the defaults; change one only when its element uses custom markup.
| Target | Default selector | Change it when |
|---|---|---|
| Products container | .products |
the product grid wrapper has a custom class |
| Pagination | .woocommerce-pagination |
pagination stays stale after filtering |
| Result count | .woocommerce-result-count |
the count text does not match the result |
| OrderBy / sort | .orderby |
the sort control is not updated or preserved |
Steps
- Reproduce the issue on the storefront and note which element is stale.
- Find that element's selector in the theme markup, for example the real
- Open the AJAX selector settings for the filter and replace only the
- Save and retest. Filter again and confirm the previously stale element now
- Repeat per element if more than one is affected.
class on the products wrapper.
selector for the broken element.
updates.
Expected result
After filtering, products, pagination, result count, and the sort control all update together, with no full page reload.
Troubleshooting
- Nothing updates at all. The products container selector is likely wrong;
- Works on shop but not on category pages. A different template may wrap the
fix it first, since the others depend on the loop being found.
loop differently — confirm the selector exists on every page that shows the filter.
Related
- Tutorial: Create your first WooCommerce product filter.
- How-to: Troubleshoot theme and page-builder conflicts.
- Explanation: How the AJAX request and response work.