- Priority
- Nice to have Weight 1. Helps agents, rarely decisive on its own.
- Readiness level
- Not a level gate. It counts toward its section score.
- Platform
- Runs only when the scan recognises WooCommerce. On any other platform it is left out of the report and never scored.
- The question
- Do the sitemap and the Store API agree on catalog size?
On this page
In short
A WooCommerce store describes its catalog in two public places: the product sitemap (the list of product pages it publishes for crawlers) and the Store API (the public product interface built into WooCommerce). If they disagree on how many products exist, an agent cannot tell which one is complete. This check compares the two counts and passes when they are within 10 percent of each other.
What this check looks at
The check runs only on WooCommerce stores. On other platforms it does not run and reports leave it out. It compares two numbers.
- The sitemap count. The number of product URLs the scanner found in your sitemap. It is the same set of URLs the product URLs in sitemap check reports.
- The Store API count. The Store API lives at
/wp-json/wc/store/v1/and needs no login. A request to its product list returns anX-WP-Totalresponse header with the total number of products it can list. The Store API check confirms the API answers at all.
The scanner asks for /wp-json/wc/store/v1/products?per_page=1, which returns one product and the total in the header.
Why it matters for AI agents
Agents and the crawlers behind AI answers discover products in different ways. A search crawler reads the sitemap. An agent that talks to a WooCommerce store directly may page through the Store API. When the two sources describe different catalogs, some products are visible to one kind of reader and missing for the other.
A large gap usually points to a real problem. Products may be missing from the sitemap, so crawlers find them late or never. Or the sitemap may list products the store no longer sells, which sends agents to dead or hidden pages.
This check has weight 1, nice to have, and gates no level. Treat a failure as a pointer to look for missing or stray products, not as a blocker.
How the scanner decides
The deviation is the difference between the two counts divided by the larger count.
- Skip when the product URLs in sitemap check or the Store API check failed or was skipped, when the site has no sitemap, or when not every product sitemap could be read within the scan's request budget. A partial count would be unfair.
- Skipped as inconclusive when the Store API answers 429, 502, 503 or 504, or does not answer.
- Fail when the Store API does not answer with a numeric
X-WP-Totalheader, or when either count is zero. - Pass when the deviation is 10 percent or less.
- Warn when it is more than 10 percent and up to 25 percent.
- Fail when it is more than 25 percent.
For example, 180 sitemap URLs against 200 Store API products is 10 percent apart and passes. 140 against 200 is 30 percent apart and fails. The evidence lists the sitemap files read, both counts and the ratio.
How to fix it
Find out which side is wrong first. Pick a few products that appear in one source and not the other, and look at their settings.
WordPress and WooCommerce
- Check which plugin builds the sitemap. WordPress core builds one at
/wp-sitemap.xml. SEO plugins such as Yoast SEO and Rank Math replace it with their own, usually with aproduct-sitemap.xml. Only one should be active. - Look for products excluded from the sitemap. SEO plugins drop products marked noindex. A product set to noindex by mistake disappears from the sitemap but stays in the Store API.
- Check catalog visibility. In the product editor, the Catalog visibility setting under Publish can hide a product from the shop and search. Hidden products and the sitemap may be treated differently depending on the plugin.
- Check the out-of-stock setting. Under WooCommerce, Settings, Products, Inventory, the option to hide out-of-stock items from the catalog can change what one source lists and not the other.
- Remove stale entries. If the sitemap is larger, look for drafts, trashed products or old URLs kept by a cached sitemap. Clear the SEO plugin's sitemap cache after you fix them.
- Split large sitemaps correctly. A sitemap index with many child files is fine. Make sure every child file is listed in the index and answers HTTP 200.
Verify it yourself
Read the Store API total:
curl -sI "https://example.com/wp-json/wc/store/v1/products?per_page=1" | grep -i x-wp-total
Count the URLs in your product sitemap. With Yoast SEO, the file is usually product-sitemap.xml. With WordPress core, it is wp-sitemap-posts-product-1.xml:
curl -s https://example.com/product-sitemap.xml | grep -c "loc>"
If the product sitemap is split into several files, add up the counts. Some image sitemaps add extra loc entries, so treat this as an estimate. The scanner's evidence gives the exact count it used.
Common mistakes
- Two sitemap generators at once. WordPress core and an SEO plugin each publish a sitemap, and robots.txt points to the one that is out of date.
- Noindex left on after a launch. Products imported with noindex during staging never enter the sitemap.
- A cached sitemap. The plugin's sitemap cache or a CDN serves a file from before the last catalog import.
- Expecting variations to count. The Store API counts parent products, and a sitemap lists product pages. Individual variations of a variable product appear in neither count.
- Blocking the Store API. A security plugin that blocks
/wp-json/makes the check fail because there is no total to compare.
FAQ
What is the X-WP-Total header?
It is a response header the WordPress REST API, and WooCommerce's Store API with it, adds to list requests. It states the total number of items the list holds across all pages, so a client knows the size without fetching every page.
Why does my sitemap have fewer products than my store?
The most common causes are products marked noindex, products hidden from the catalog, and a sitemap cache that has not caught up with a recent import. Compare a missing product's SEO and visibility settings with one that appears.
Is it a problem if the counts differ by a few products?
No. Up to 10 percent passes. Small differences come from timing, such as a product published between two cache refreshes.
Does this check run on Shopify or other platforms?
No. It needs the WooCommerce Store API, so it runs only on WooCommerce. On Shopify, the products.json check and the agentic storefront check cover the catalog.
The fix in one step
Make the sitemap and the Store API agree: list every published, visible product in the product sitemap, and keep hidden, draft and deleted products out of it.
Prompt for a coding agent
On this WooCommerce site, the number of product URLs in the sitemap differs by more than 10 percent from the product total the Store API reports in the X-WP-Total header of /wp-json/wc/store/v1/products?per_page=1. Find which side is wrong by comparing a few products that appear in only one of them. Usual causes: two sitemap generators at once (WordPress core and an SEO plugin), products set to noindex, the Catalog visibility setting, the option to hide out-of-stock items, drafts or old URLs in a cached sitemap, and child sitemaps missing from the sitemap index. Fix the settings, clear the SEO plugin's sitemap cache and any CDN copy, and make sure robots.txt points to the active sitemap. Verify that the X-WP-Total value and the count of `<loc>` entries across the product sitemap files are within 10 percent of each other.
Sources and specifications
See how your store does
One scan runs every check in this knowledge base against your site and ends with a prioritised fix list.