Delete category base” option – 404 errors

#820562
  • Resolved Yohann Josselin
    Rank Math free

    Hello,

    I’ve activated the “Delete category base” option in the “Woocommerce” section of the general settings, but it’s causing a lot of problems.

    Sometimes my category pages become inaccessible at the url without the category base. The problem is that my site is built with these slugs, so I end up with 404 errors all over the site.

    To solve this problem I have to deactivate and reactivate the plugin, sometimes it doesn’t work and I have to deactivate and reactivate the “Delete category base” option.

    The problem is that this error occurs regularly and randomly, so it’s unmanageable….

    This problem has been happening for about 2 months. I have two woocommerce sites that use rankmath and I get this problem on both sites [Moved to the sensitive data section].

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello,

    I apologize for the inconvenience you are facing with the "Delete category base" option in Rank Math causing 404 errors on your WooCommerce sites. It seems like there might be a conflict or issue with how the URLs are being handled after enabling this option.

    To address this problem, I recommend checking the permalink settings in WordPress to ensure they are set correctly. Additionally, you can try the following steps:

    1. Flush Permalinks: Go to your WordPress admin dashboard, navigate to Settings > Permalinks, and click on "Save Changes" to flush the permalinks.

    2. Check for Plugin Conflicts: Deactivate all other plugins except Rank Math and WooCommerce temporarily to see if the issue persists. If the problem goes away, reactivate the plugins one by one to identify the conflicting plugin.

    3. Review Category Slugs: Ensure that your category slugs do not conflict with other post, page, or product slugs to avoid unexpected results.

    If the issue persists after trying these steps, please consider reaching out to our dedicated support team by clicking here. They are available 24/7 and will assist you in resolving this matter effectively.

    Thank you for bringing this to our attention, and we appreciate your patience while we work on resolving this issue for you.

    Warm regards.

    Sources:
    WordPress Permalink Structure & Changing Individual URLs » Rank Math
    How to Remove the Category Base From WordPress » Rank Math
    How to Disable Custom Product Redirection in Rank Math » Rank Math

    Hello,

    Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.

    We moved your website URLs to the sensitive data section which is fully private.

    However, from the description you’ve shared, it looks like the permalinks are not sticking for more than a couple of hours and that’s why you’re facing this issue frequently. We’ve seen some similar issues in the past and the most common fix for this kind of issue is to refresh the permalinks programmatically.

    To do that, you could add the following snippet to flush the permalinks every hour and prevent the error from appearing:

    add_action('my_hourly_event', 'do_this_hourly');
     
    function my_activation() {
        if ( !wp_next_scheduled( 'my_hourly_event' ) ) {
            wp_schedule_event(time(), 'hourly', 'my_hourly_event');
        }
    }
     
    add_action('wp', 'my_activation');
     
    function do_this_hourly() {
        global $wp_rewrite;
        $wp_rewrite->flush_rules();
    }
    

    Here’s how you can add filter/hook to your WordPress site: https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Let us know how it goes. Looking forward to helping you.

    Thank you.

    Hello,

    Thanks for your reply, I added the code and I’ll monitor if I’ve got the issue or not during the next days.

    Best regards,

    Hello,

    Sure, let us know how this goes.

    Meanwhile, please don’t hesitate to contact us anytime if you have other questions to assist you further.

    Looking forward to helping you.

    Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)

The ticket ‘Delete category base” option – 404 errors’ is closed to new replies.