Skip to main content
WooCommerce guide

404 Error for WooCommerce Stores

By ยท Updated ยท 7 min read

Why WooCommerce Stores Generate 404 Errors Differently

WooCommerce introduces several URL patterns that vanilla WordPress never creates: product pages, product category archives, product tag archives, shop base slugs, and variation URLs. When any of these routes break โ€” because a product is deleted, a category is renamed, or the shop page is reassigned โ€” WordPress returns a 404 rather than a redirect. This is structurally different from a simple post deletion because WooCommerce registers its own rewrite rules through its custom post type 'product' and custom taxonomies 'product_cat' and 'product_tag'.

The shop base slug (defaulting to /shop/) is a single point of failure that affects every product URL beneath it. If a store owner changes the shop base in WooCommerce > Settings > Products > General, every indexed product URL breaks simultaneously. WordPress flushes its rewrite rules, but it creates zero redirects for the old paths. Google's crawl budget takes the full hit before the operator notices the problem in Search Console.

The Four Most Common WooCommerce 404 Sources

Deleted or trashed products are the top source. WooCommerce moves a product to the trash when a merchant removes it, and WordPress immediately returns 404 for that slug. No archive or redirect is created automatically. For stores with high product turnover โ€” seasonal SKUs, limited-edition drops, discontinued variants โ€” this means a constant drip of broken URLs accumulating in Google's index.

Permalink structure changes cause mass 404 events. Switching from a flat structure like /product/red-shoes/ to a category-prefixed structure like /product-category/footwear/red-shoes/ orphans every previously indexed URL. WooCommerce does not write htaccess rules or database redirects for this change. The third major source is variation URLs: some themes and plugins generate browsable URLs for variable product attributes (color, size), and those URLs vanish when the variation is removed. Finally, plugin conflicts can deregister WooCommerce's rewrite rules, making the entire /product/ base return 404 until the rules are flushed manually via Settings > Permalinks > Save.

WooCommerce-Specific Tools and Plugins for 404 Management

Redirection (by John Godley) is the most widely deployed redirect manager in the WordPress ecosystem and works reliably with WooCommerce slugs. It logs 404s in a database table, lets operators create 301 redirects from inside wp-admin, and supports regex patterns โ€” useful for redirecting all deleted product slugs in a category to the category archive page. The plugin does not auto-create redirects on product deletion, so manual review of the 404 log remains necessary.

Yoast SEO Premium includes a redirect manager that hooks into WordPress's post transitions. When a product's slug is changed in the editor, Yoast Premium automatically writes a 301 from the old URL to the new one. This covers slug-edit scenarios but still misses trash or permanent deletion. Rank Math Pro offers equivalent functionality. For stores that want automatic deletion-triggered redirects, a custom wp_trash_post action hook pointing deleted product URLs to the parent category is the standard developer workaround, since no mainstream free plugin handles this automatically.

WooCommerce's own REST API and webhooks do not include built-in 404 alerting. Stores relying on headless or PWA frontends built on WooCommerce's API must implement their own middleware to catch missing product IDs โ€” the platform has no native fallback URL resolution for decoupled frontends.

Permalink Settings and Rewrite Rule Conflicts

WooCommerce registers its rewrite rules during plugin initialization, and those rules can be overwritten by other plugins that also call add_rewrite_rule() or flush_rewrite_rules(). The symptom is product pages returning 404 even though the post exists in the database and its status is 'publish'. The standard fix is navigating to Settings > Permalinks and clicking Save Changes without altering anything โ€” this forces WordPress to regenerate the rewrite rules cache stored in the wp_options table under 'rewrite_rules'.

Custom post type plugins that register slugs conflicting with /product/ or /shop/ are a less obvious culprit. If another plugin claims the /shop/ base slug, WooCommerce's shop page 404s on every visit. WooCommerce's own health check tool (WooCommerce > Status > Tools > Flush Rewrite Rules) provides a one-click flush without requiring a Permalinks page visit, which is useful in automated maintenance scripts.

Handling 404s on the WooCommerce Shop and Category Archives

The main shop archive page is a standard WordPress page assigned in WooCommerce > Settings > Products > Shop page. If that page is deleted or its slug changes, the entire store front returns 404. Unlike individual product 404s, this failure is immediately visible to all visitors. Reassigning a published page in that setting resolves the 404 instantly without needing a permalink flush.

Product category (product_cat) archive 404s occur when a category is deleted without first reassigning its products. The products themselves remain accessible, but the category URL โ€” which may carry significant link equity โ€” returns 404. The correct workflow before deleting any category with external backlinks is to set up a 301 redirect from the category URL to a relevant replacement archive, then delete the category. No WooCommerce setting automates this step.

Actionable Priorities for WooCommerce Store Operators

Audit Google Search Console's Coverage report filtered to 'Not found (404)' every two weeks. Cross-reference the flagged URLs against the product and category slugs currently in WooCommerce. Any deleted product URL that appears in Search Console with external backlinks warrants a 301 to the closest relevant category or replacement product, not to the homepage. Homepage redirects dilute link equity and train crawlers to ignore the redirect.

Install a 404 logging plugin before making any permalink or shop-base change. Capture baseline traffic to affected URL patterns, make the change, then immediately create batch redirects for all old-pattern URLs. Test rewrite rule integrity after every WooCommerce major version update by visiting a live product URL in an incognito browser โ€” updates occasionally reset custom rewrite configurations. For stores with more than 500 SKUs, script a wp-cli command (wp post list --post_type=product --post_status=trash) to surface trashed products whose old slugs may still be indexed.

Frequently asked questions

Does WooCommerce automatically redirect old product URLs when a slug changes?

No. WooCommerce does not create redirects when a product slug is edited or when a product is deleted. Yoast SEO Premium and Rank Math Pro hook into the post-save transition to auto-create a 301 when a slug is manually changed inside the editor, but neither plugin handles the trash or permanent deletion case automatically. A custom wp_trash_post hook or manual redirect entry is required for deletion scenarios.

Why do WooCommerce product pages suddenly return 404 after a plugin update?

Plugin updates can flush or overwrite WordPress rewrite rules, which WooCommerce uses to route /product/ and /shop/ URLs. When another plugin calls flush_rewrite_rules() without WooCommerce re-registering its own rules first, product pages return 404 even though the database records are intact. The fix is to visit Settings > Permalinks and click Save Changes, or use WooCommerce > Status > Tools > Flush Rewrite Rules.

What is the best redirect destination for a deleted WooCommerce product?

Redirect to the closest parent category archive, not to the homepage. A category-level redirect preserves topical relevance for crawlers and gives visitors a browsable alternative. If the product has a direct replacement, redirect to the replacement product page instead. Sending all deleted product 404s to the homepage is a common error that dilutes link equity and signals low-quality redirect behavior to search engines.

How does changing the WooCommerce shop base slug affect indexed URLs?

Changing the shop base in WooCommerce > Settings > Products > General immediately orphans every indexed product URL. A store with 1,000 products using /shop/product-name/ will have 1,000 URLs returning 404 after switching to /store/product-name/. WooCommerce writes no automatic redirects for this change. Operators must generate a redirect map from old slugs to new slugs before making the change, using a plugin or server-level rewrite rules.

Can WooCommerce variable product variation URLs cause 404 errors?

Yes. Some themes and plugins generate distinct, indexable URLs for each product variation (for example, /product/t-shirt/?attribute_color=red). When a variation is removed from the product, its URL returns 404. These are not always captured in standard 404 logs if the URLs are query-string based rather than path-based. Canonical tags on variation URLs pointing to the parent product page help prevent these from accumulating as indexed 404s.

MG
Written by

Matt is the founder of RunOctopus. He built All Angles Creatures from zero to page-1 rankings in reptile feeder insects in under 60 days using exactly this method โ€” turning a hard, entrenched niche into RunOctopus's proof store for programmatic SEO and AI search citation.

Connect on LinkedIn →

See what Otto would build for your store

Free architecture preview. No card required. Five minutes.

Generate Preview →