WOOT - WooCommerce Active Products Tables

WooCommerce product table slow? Speed it up on large catalogs

A WooCommerce product table that is slow on a big shop is rarely slow because of the number of products. The table never asks the server for the whole catalog: it asks for one page of rows at a time, so with a simple query a 20-row page costs much the same on a shop with 500 products as on one with 50,000. When a table is slow, it is usually because a setting loads far more rows than needed, the database query behind each page is expensive, or the whole site is slow. Below is how the table loads, which settings matter, what to cache and how to measure the result.

How the table loads its rows

The [woot] shortcode prints an empty table frame and a hidden block with the table's settings. After the page has loaded, the browser sends a POST request to /wp-admin/admin-ajax.php with the action woot_get_table_data. The server runs one WordPress product query for the current page only, builds the cells of the active columns for those products and returns them as JSON.

  • Each page change, sort, filter change and search sends one new request for one page of rows.
  • The browser keeps every answer while the page is open, so returning to a page that was already shown does not ask the server again. This does not apply when Use load more button is on.
  • A variable or grouped product gets a button in its row. Its variations table is requested only when a customer clicks that button.
  • WOOT adds its scripts and styles only to pages where one of its shortcodes is printed. Pages without a table load nothing from the plugin.

So the cost of a table is roughly the cost of one query plus rows per page × active columns cells, repeated for every click. Keep both small and the catalog size stops mattering.

Settings that load the whole catalog at once

A few settings remove the page limit. On a catalog of thousands of products, any of them makes the first request heavy enough to time out, and the table then stays on Loading ....

SettingWhat it doesUse instead
Per page default = -1 (Options tab)Loads every matching product in one request and hides the pagination10 to 25
Large numbers, or -1 in a list, in Per page valuesLets every visitor pick that amount (-1 means all) in the per-page drop-downFor example 10,25,50
per_page=-1 in the shortcodeSame as Per page default = -1, and it overrides the table settingRemove it or set a number
mode=to_json or mode=json in the shortcodeLoads all matching products at once, then sorts and pages them in the browser; the filter form is switched offUse only for small, fixed sets of products
Bestsellers or Newest count (Predefinition tab)The number you enter is the number of products one request loadsTens, not hundreds

Check the table's Options tab first, then the shortcode on the page: shortcode attributes override the table settings, so a forgotten per_page=-1 on one page explains why only that page is slow.

What makes a WooCommerce product table slow per request

With a sensible page size, a slow request comes from what the query has to do before it can return those rows.

Rows and columns

Every cell is computed on the server: 100 rows with 15 columns are 1,500 cells per click. Columns that read extra data for each product, such as meta fields, attributes, galleries or attachments, cost more than ID, title or price. Switch off the Active toggle of columns nobody uses in the Columns tab and keep 10 to 25 rows per page. If customers want to scroll, Use load more button appends the next page instead of loading more rows up front.

Sorting

Ordering by ID or date uses the posts table directly. Ordering by price, SKU or another meta field makes MySQL join the meta table and sort all matching products before it can cut out one page, and that grows with the catalog. Keep a cheap Default order by and use Disable columns order-by for sortable columns that customers do not need.

Search by title

The search field sends a request when the visitor presses Enter, and only if the text has at least Min symbols count characters (3 by default; do not lower it on big shops). It looks for the text anywhere inside product titles, a comparison that must check every product row and cannot use a normal index. The woot_text_search_by shortcode attribute can extend the search to post_content and post_excerpt; searching full descriptions is many times heavier than titles, so add it only when customers really need it. The FAQ on making search by product title faster covers the database side.

Predefinition rules

Most Predefinition rules only narrow the query. One detail: the Products SKU rule looks up every SKU separately, so a list of hundreds of SKUs means hundreds of extra queries on each request. For long lists use Products ids or an Included taxonomy rule instead.

The filter form

The table's own filter is built when the page is rendered. A taxonomy element loads its terms level by level, with one query for the children of each term, so a category tree with thousands of terms adds thousands of queries to every view of the page. Use the element's Include or Exclude options (term IDs) to show only the terms that make sense; excluded terms are skipped together with their children. Range elements for meta fields such as price ask the database for the lowest and highest value whenever Min and Max are left at -1; enter fixed values to skip that query. The elements are set in the Filter tab.

If the site also runs the HUSKY products filter, it starts on every page by default. Its option Init plugin on the next site pages only (Advanced tab, Code section) limits it to the pages that use it.

Caching: what helps and what to avoid

  • Persistent object cache. WordPress keeps query results, product data, meta and terms in its object cache, but by default that cache lives for one request only. With Redis or Memcached, for example through the Redis Object Cache plugin, it survives between requests. Table requests repeat the same queries again and again, and the filter form's term queries are cached too, so this is the cache that speeds up tables most. The hosting must provide the Redis service.
  • Page cache. Safe for pages with tables: the rows always come from the POST request, which page caches and CDNs do not store. The cached page does carry the table's settings block, so purge the page cache after changing table settings, or the old page size and columns keep being served.
  • Never cache the AJAX answers. Do not enable features or CDN rules that cache admin-ajax.php responses. Visitors would get stale prices and stock, and the wrong products after filtering.

Optimizers, Cloudflare and script delay

Combining, minifying and deferring scripts speeds up the page itself, and the table does not need any of it switched off globally. It does need its scripts to run in order after the page has loaded. Exclude /wp-content/plugins/profit-products-tables-for-woocommerce/ (and woocommerce-products-filter if HUSKY is used) from JavaScript combine, delay and defer. In Autoptimize, add these folder names to Exclude scripts from Autoptimize. Cloudflare Rocket Loader also changes when scripts run; if tables break with it, turn it off for the pages with tables. A table that never finishes loading after such a change is covered step by step in products table stuck on Loading.

Measure before and after each change

  1. Open the page logged out, open the browser's developer tools (F12), go to Network and reload. Type admin-ajax in the filter field and click the request with woot_get_table_data in its payload. Its Timing tab shows Waiting for server response: that is the time the server needed for one page of rows.
  2. Compare it with the page document itself, and with a page that has no table. If every page is slow, the table is not the cause: look at hosting resources, the theme and the plugins that run on every page.
  3. Put the same table on a draft page with a minimal shortcode, for example [woot id=3 per_page=10 disable_filter_form=1], and compare the timing. Then add the filter, sorting and columns back one at a time to find the expensive part.
  4. If the request ends with 500, 502, 503 or 504 instead of being slow, it fails rather than lags: enable the WordPress debug log and read wp-content/debug.log, as described in the article linked above.

Checklist

  • Per page default is 10 to 25, and no shortcode on the page uses per_page=-1 or mode=to_json on a large set.
  • Per page values offers no -1 option and no values in the hundreds.
  • Unused columns are disabled; sorting by meta fields is off where nobody needs it.
  • Taxonomy filter elements are trimmed with Include or Exclude; price ranges have fixed Min and Max.
  • A persistent object cache is active; admin-ajax.php responses are never cached.
  • The plugin's scripts are excluded from combine and delay; the page cache is purged after settings changes.

If the woot_get_table_data request still takes several seconds with ten rows and no filter, open a topic on the WOOT support forum with the page link, the shortcode and the request timing, and we will look at it.