|
/ Documentation /Developers Documentation/ Remove Product Category Base surerank_remove_product_category_base

Remove Product Category Base surerank_remove_product_category_base

Hook: surerank_remove_product_category_base

Description: This filter allows you to remove the default /product-category/ base from WooCommerce product category URLs. By enabling this, your category URLs will be cleaner and more SEO-friendly — for example, /product-category/shoes/ becomes /shoes/.

Source: inc/frontend/archives.php

Use Case: Ideal for users who want to shorten product category URLs for better readability and search engine optimization.

Usage: Shorten product URLs

Example:

PHP
// Enable the option to remove the 'product-category' base from product category URLs in SureRank
add_filter( 'surerank_remove_product_category_base', '__return_true' );

Note: Make sure permalink settings are flushed after applying this filter to reflect changes on the frontend.

You can add the example code to your child theme’s functions.php file or use a plugin like Code Snippets to safely insert custom code. Using a code snippet plugin is recommended for easier management and to ensure the code remains active even if you switch themes.

Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
On this page
Scroll to Top