Support » Plugin: Rank Math SEO with AI SEO Tools » Woocommerce Remove Category Base

  • Resolved wanderingexplorer

    (@wanderingexplorer)


    Hello.

    I had a similar issue with this setting before. Raised the issue and it got fixed. Now another issue with the same setting. Please can someone look at this closely and try to future proof this. When I update RankMath it is pretty hit and miss for me. Sometimes no issues, sometimes my site doesn’t work :-(.

    Further Details…

    When you turn on “Remove Category Base” under WP Admin->Rank Math->General Settings->WooCommerce

    My single product pages stop working and I get the following error displayed “The page isn’t redirecting properly”.

    Testing with [http://www.redirect-checker.org/index.php] I can see this setting is causing a redirect loop. For example:

    https://www.mysite.com/tours/weekend-in-paris -> https://www.mysite.com/weekend-in-paris/ -> https://www.mysite.com/tours/weekend-in-paris -> https://www.mysite.com/weekend-in-paris/

    Notice the absence of the “tours” (shop page) and additional slash on the end.

    Thank you.

    PS This is quite severe (breaking woocommerce sites) and so I think it warrents quick escalation!

Viewing 1 replies (of 1 total)
  • Plugin Author Rank Math

    (@rankmath)

    Hello @wanderingexplorer

    Thank you for contacting the support and apologies for a delayed response.

    Thank you for contacting the support.

    Our Development team is working on this issue and they will be releasing an update soon with the fix.

    For now, to fix it on your website, please replace the can_redirect function on line 102 in seo-by-rank-math/includes/modules/woocommerce/class-product-redirection.php with the following code:

    private function can_redirect() {
    		if (
    			$this->do_filter( 'woocommerce/product_redirection', true ) &&
    			( ( Helper::get_settings( 'general.wc_remove_product_base' ) && is_product() ) ||
    			( Helper::get_settings( 'general.wc_remove_category_base' ) && is_product_category() ) )
    		) {
    			return true;
    		}
    
    		return false;
    	}

    That should fix the issue on your site.

    Hope that helps.

Viewing 1 replies (of 1 total)
  • The topic ‘Woocommerce Remove Category Base’ is closed to new replies.