Cannot fully disable Rank Math Sitemaps – still redirected to homepage

#1071358
  • Resolved Jesus
    Rank Math free

    Hello,

    I’ve deactivated the Sitemap module in Rank Math, as I’m using a different plugin for XML and Google News sitemaps.

    However, even after disabling the module via the Rank Math settings (and verifying that the sitemap_module is off), the old Rank Math sitemap URLs like:

    /sitemap_index.xml

    /post-sitemap1.xml

    /page-sitemap.xml

    …are still redirecting to the homepage (302 or 301 redirects), instead of returning a 404 or letting the new plugin take over.

    I’ve verified that:

    No redirection plugins are active.

    .htaccess has no manual redirects.

    The new sitemap plugin works when tested on other URLs.

    This behavior seems hardcoded or persistent even after disabling your module.

    🔧 I even tried deleting relevant rank_math_options rows from the database and flushing rewrite rules, but these sitemap URLs still get intercepted.

    Please confirm how to completely remove or unregister Rank Math’s sitemap rewrites and filters.
    Ideally, disabling the sitemap module should remove all trace of it from the frontend routing.

    Thank you.

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

    We apologize for the issue you are facing with the Rank Math sitemaps still redirecting to the homepage even after deactivating the module. Thank you for providing detailed information about the steps you’ve already taken.

    To completely remove or unregister Rank Math’s sitemap rewrites and filters, you can try the following steps:

    1. Check for Hardcoded Redirects: Sometimes, themes or other plugins may have hardcoded redirects. Ensure that your theme or any other active plugins are not causing these redirects.

    2. Flush Rewrite Rules: You mentioned that you’ve already flushed rewrite rules, but it’s worth trying again after making sure that the sitemap module is disabled. You can do this by going to Settings → Permalinks in your WordPress dashboard and simply clicking Save Changes.

    3. Custom Code: If the above steps do not resolve the issue, you can add a custom code snippet to your theme’s functions.php file to unregister the sitemap functionality. Here’s a code snippet you can use:

      add_action( 'init', function() {
         remove_action( 'template_redirect', 'rank_math_sitemap' );
      });

      This code will help in removing the Rank Math sitemap action from being executed.

    4. Check .htaccess File: Although you mentioned there are no manual redirects in your .htaccess, it’s good to double-check for any unexpected rules that might be affecting the sitemap URLs.

    If these steps do not resolve the issue, we recommend replying to this ticket so a human agent from the Rank Math Support team can assist you further. Please include your site URL in your reply for more accurate assistance.

    Thank you for your understanding, and we hope to resolve this issue for you soon!

    Hello,

    Thank you for contacting us. We apologize for any inconvenience this issue may have caused.

    Kindly navigate to WordPress Dashboard > Rank Math SEO > General Settings > Redirections > Fallback Behaviour and set it to Default 404:
    https://i.rankmath.com/i/0VZOWW

    Then clear all caches and check the situation again.

    Let us know how this goes.

    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 2 replies - 1 through 2 (of 2 total)

The ticket ‘Cannot fully disable Rank Math Sitemaps – still redirected to homepage’ is closed to new replies.