Maybe because you have only one product category and therefore search engines would find duplicate content (Shop page = Category page) and penalize your website.
Or maybe because you use advanced product filters and you prefer customers to see the filtered view “by category” (e.g. “example.com/shop/?_product_category=tables“) as opposed to the default category pages ( “example.com/product_category/tables” ).
Either way, it is possible to programmatically redirect all product category pages to a given page or to a relevant URL with parameters – and here’s the fix. Enjoy!
PHP Snippet 1: Redirect All Product Category Pages to Shop Page
This code still works, unless you report otherwise. To exclude conflicts, temporarily switch to the Storefront theme, disable all plugins except WooCommerce, and test the snippet again: WooCommerce troubleshooting 101
WooCommerce: Custom Add to Cart URLs – The Ultimate Guide In WooCommerce you can add a product to the cart via a custom link. You just need to use the “add-to-cart” URL parameter followed by the product ID. This tutorial will show you how to create custom URLs to add simple, variable and grouped products to the cart – as well as defining the add […]
WooCommerce: Add Second Description @ Product Category Pages In terms of SEO, if you’re trying to rank your product category pages, you really need to make the most of the default WooCommerce product category “description” and “thumbnail”. Most themes, if compatible with WooCommerce, will show this content right below the product category name and above products. Nothing new so far. But what if […]
WooCommerce: Show Category For Each Product @ Shop Page A client of mine has a category called “Brand”. Each product is assigned to a specific Brand subcategory e.g. Nike, Adidas, etc. The goal of this task was to show the “Brand” subcategories in the shop/category/loop pages as a way to help the user identify the brand name. The same can be applied to showing […]
WooCommerce: Should I Noindex Product Tag Pages? Ah, yet another million dollar question. If you have organized your WooCommerce products properly, you have “N” product categories and “M” product tags, where “M > N” (actually, if there were such a thing in algebra, it should be “M >>> N” as each product should be assigned to 1 category and multiple tags). This […]
WooCommerce: Change Product Permalinks @ Shop / Loop Pages A BloomerArmada fan asked me a very interesting question: how can I link each product in the shop page to its own custom landing page as opposed to the default permalink? Of course this applies when you don’t want to use the default single product page for all or some products. Clearly, you could set […]
Business Bloomer Founder
Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza. Follow @rmelogli