Cache Post Counts

July 3, 2026

WordPress and WooCommerce constantly want to know how many posts exist in each status: how many are published, how many are drafts, how many are pending, and so on. To work that out they run a COUNT query that scans wp_posts and groups by status. On a small site this is instant and nobody notices. On a large site with hundreds of thousands or millions of rows, that count is slow, and the real problem is that it runs constantly – every time you open the Posts or Products list screen, and repeatedly during an import as rows are added. You end up paying for the same expensive scan over and over.

The Cache Post Counts option removes that repeated work. Instead of recalculating the counts from scratch each time, it stores them in a dedicated cache table and reads them back instantly. The numbers you see on the list screens and the numbers WordPress and WooCommerce rely on internally are served from that cache rather than from a fresh scan of wp_posts. The saving is largest exactly where it hurts most: during big imports, where those counts would otherwise be recalculated on every row.

You’ll find this in the Imports tab under "Cache Post Counts". Turn it on and the caching applies straight away.

In short: WordPress recalculates post counts far more often than it needs to, and that scan gets expensive as your tables grow. Cache Post Counts holds the numbers in a cache table so they’re read instantly, which speeds up your imports and the Posts and Products list screens.

×
1/1