Sitemap Error

#676920
  • Resolved hassan olkom
    Rank Math free

    Hello Dear,

    I have problem with sitemap time to time it show me error 404 i fix it by saving Permalink Settings
    page but after a while it return the error 404 please help me solve this issue

    Regards,
    Thanks.

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

    I’m sorry to hear that you’re experiencing issues with your sitemap showing a 404 error intermittently. This can be frustrating, but I’m here to help.

    It seems like you’ve already tried flushing the permalinks to fix the issue. However, if the problem persists, there might be other factors causing this error.

    To address this, you can try flushing the sitemap cache in Rank Math. Here’s how you can do it:

    1. Navigate to Rank Math SEO → Sitemap Settings in your WordPress admin area.
    2. Change the value in the Links Per Sitemap field and then change it back to its original value.
    3. Click on the Save Changes button at the bottom of the page.

    Change Links Per Sitemap

    This should help refresh the sitemap and resolve the 404 error issue. If the problem persists, please let us know, and we’ll be happy to assist you further.

    Best regards.

    Sources:
    Why the Sitemap_Index.xml is Throwing a 404 Error » Rank Math
    Rank Math Sitemap Issues and Their Fixes » Rank Math
    How to Fix “Incorrect HTTP Header Content-Type” Error in Sitemaps » Rank Math
    How to Configure Sitemaps in Rank Math – Best Settings and Tips

    Hello,

    From your description, it appears your sitemap might be heavily cached. Kindly follow these steps:

    1. Exclude the Sitemap files of the Rank Math plugin in your caching plugin. The cache could be via a plugin or from the server. For plugins or Cloudflare, please follow this article: https://rankmath.com/kb/exclude-sitemaps-from-caching/

    2. If the issue persists then try disabling the transient cache for the sitemap. This will make sure that your XML sitemap always reflects the latest changes on your site. To do this, you need to add a small piece of code to your site’s functions.php file or use a plugin like Code Snippets.
    The code you need to add is this:

    /** 
     * 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/.

    It will show you step-by-step how to use the Code Snippets plugin or edit the functions.php file safely.

    After you add the code, please clear any cache on your site or server and check your XML sitemap again. If you’re still facing issues with the sitemap, please let us know – we are happy to investigate further.

    We hope this helps. Please let us know if you have further questions or concerns.

    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 ‘Sitemap Error’ is closed to new replies.