XML Sitemap not working – have tried all suggested fixes

#1107577
Viewing 6 replies - 1 through 6 (of 6 total)
  • Hello,

    We apologize for the issue you are facing with the sitemap not working. Since you’ve already tried the suggested fixes from the article, we recommend checking a few additional things:

    1. Flush Permalinks: Go to your WordPress admin area, navigate to Settings → Permalinks, and hit the “Save Changes” button. This can often resolve issues with sitemaps.

    2. Check for Rewrite Rules: Ensure that your server has the correct rewrite rules in place. If you’re using an Apache server, you may need to add the following to your .htaccess file:

      # START of Rank Math Sitemap Rewrite Rules
      RewriteEngine On
      RewriteBase /
      RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
      RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
      RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 [L]
      # END of Rank Math Sitemap Rewrite Rules

      For Nginx, you would need to add:

      # START Nginx Rewrites for Rank Math Sitemaps
      rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last;
      rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
      rewrite ^/([a-z]+)?-sitemap.xsl$ /index.php?xsl=$1 last;
      # END Nginx Rewrites for Rank Math Sitemaps
    3. Check for Plugin Conflicts: Sometimes, other plugins can interfere with the sitemap functionality. You can use the Health Check plugin to identify any conflicts.

    4. Validate Your Sitemap: Use a tool like Validate XML Sitemap to check if your sitemap is correctly configured.

    If these steps do not resolve the issue, please reply to this ticket, and a human agent from our support team will take over and assist you further. Thank you for your patience!

    Sources:
    Why the Sitemap_Index.xml is Throwing a 404 Error » Rank Math
    Troubleshooting the “Couldn’t Fetch” Error in Google Search Console » Rank Math

    Here is the XML Validation – you can see there’s an issue in the header – XML Validation Issue – delight design

    Hello,

    The validation is due to the sitemap not working, so it will return that as HTML.

    In this case, please disable the transient cache for the sitemap by applying this filter. This will make sure that your XML sitemap always reflects the latest changes on your site:

    /** 
     * Filter if XML sitemap transient cache is enabled.
     *
     * @param boolean $unsigned Enable cache or not, defaults to true
     */
    add_filter( 'rank_math/sitemap/enable_caching', '__return_false');

    If you’re not sure how to add this code, you can follow this guide:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Also, head over to your website files /wp-content/uploads/rankmath/, and delete any XML files from that path.

    If the issue persists, try updating the plugin to the beta version, as we have included a fix for sitemap caching issues.

    Here’s a guide you can follow:
    https://rankmath.com/kb/version-control/#beta-updates

    Let us know how this goes.

    Hi Reinelle,

    Thanks for suggesting these, however none of these fixes worked. If easier, I’m happy to create a temporary admin account. Let me know.
    I’m really keen to get this working as have done lots of optimization!
    Kris

    Hello,

    Sure! Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.

    Please do take a complete backup of your website before sharing the information with us.

    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    Looking forward to helping you.

    Thank you.

    Hello,

    We would like to debug this issue further. Can you add your website’s FTP login in the Sensitive Data section of this ticket?

    Looking forward to helping you with this one.

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

The ticket ‘XML Sitemap not working – have tried all suggested fixes’ is closed to new replies.