We had 85 pages that could rank for a shopping query: 42 categories, 43 brand pages. Everything else was a product page or an article. For a 27,000-item catalog, that is a thin middle layer — nothing to catch searches that are more specific than "bags" but less specific than one exact item.
This week we built 141 collection pages out of the two taxonomies we already had. Not 141 hand-written landing pages. 141 generated routes, each with its own H1, intro, product grid, FAQ and canonical.
The structure
Two dimensions, multiplied where there is enough stock:
- Brand × category, including sub-categories, with a threshold of 10 products. Chanel × bags, Chanel × shoulder bags, Chanel × mini bags, and so on.
- Price band, 7 of them, applied per category. Bags under $300, bags $300–600, watches $600–1,200.
That is 12 brand-category dimensions plus 7 price bands, intersecting to 141 URLs that clear the threshold. At a threshold of 25 it would have been 48 — most of the long tail would have failed, and the long tail is the point. Ten products is the floor at which a grid page still looks like a selection rather than a mistake.
Each page carries:
- an H1 and a one-paragraph intro written per dimension, not templated
- 24 products in the grid
- 3 category-appropriate FAQ pairs, with
FAQPageJSON-LD - a self-referencing canonical, its own title and meta description
- 6 internal links to related collections
Route: /collections/<slug>/. Deliberately not /product-category/brand/category/ — WooCommerce would have handled that with layered navigation and ?filter_ parameters, which is exactly the duplicate-URL mess we were trying to avoid.
The fatal error, and why it was worth having
My first version registered the sitemap the documented way:
add_action('init', function () { wp_register_sitemap_provider('collections', new class extends WP_Sitemaps_Provider { public function get_url_list($page_num, $post_type = '') { /* ... */ } }); }); The anonymous class did not extend WP_Sitemaps_Provider properly — I had the namespace wrong — and the result was not a warning. It was a white screen on every page of the site. A fatal error in mu-plugins takes the whole storefront with it, including the admin, which means you cannot log in to disable the plugin that broke the site.
Recovery was SSH and mv the file out of mu-plugins. Two minutes, but two minutes of a completely dead store during which every visitor got a 500.
The rewrite drops the provider API entirely:
add_action('template_redirect', function () { if (strpos($_SERVER['REQUEST_URI'], '/collections-sitemap.xml') === false) return; header('Content-Type: application/xml; charset=UTF-8'); echo '<?xml version="1.0" encoding="UTF-8"?><urlset ...>'; foreach ($slugs as $slug) { /* <url><loc>...</loc></url> */ } echo '</urlset>'; exit; }); A static XML file generated on request. No provider class, no WP_Sitemaps_Provider assumptions, no fatal error surface. It is less idiomatic and I do not care.
One detail that cost me an hour: WordPress sends 404 headers from WP::handle_404() after template_redirect in some request shapes. The sitemap returned valid XML with a 404 status — Google would never have fetched it. Fix was status_header(200) plus clearing the 404 flag before output. It now returns 141 <loc> entries and sits in robots.txt next to wp-sitemap.xml.
Template gotcha nobody warns about
Our product card template reads global $product. Inside a WP_Query loop on a custom route, $product is not populated — the loop function that normally sets it only runs in WooCommerce's own templates. First render produced 26 empty cards. Fix is to call wc_setup_product_data($post) (or set the global manually) inside the loop before including the card.
What 141 pages actually buy you
Honest accounting. They will not outrank a category page for "chanel bags" — the category page has more links and more history. What they can win is the mid-tail: brand plus attribute, price-bounded queries, and the internal link equity that now flows from a grid page into 24 product pages instead of flowing nowhere.
Aggregate pages went from 85 to 226. Whether that is 141 new entry points or 141 new near-duplicates depends entirely on whether the intro copy and the product mix are actually different per page. Ours are written per dimension; if yours are "Shop our {brand} {category} collection" the answer is near-duplicates, and you should not build them.
Two of them, if you want to judge the format: Chanel bags and bags under $300. The category layer they sit under is still here.
Next: the same treatment for the article layer, which is still 19 pieces against a 226-page aggregate structure. That ratio is backwards.
