sitemap post 404 error

#748429
  • Resolved Anonymous
    Rank Math free

    I’m trying to index my pages most of the sitemaps are crawled in GSC but the post-sitemap.xml. It doesn’t exist, it was fine with YOAST and after I changed to Rankmath it stopped working. I already flushed the cache and resaved the permalinks.

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

    I’m sorry to hear that you are facing issues with your post-sitemap.xml file throwing a 404 error after switching from Yoast to Rank Math. This issue can occur due to various reasons, such as missing rewrite rules or caching problems.

    Since you have already flushed the cache and resaved the permalinks, I recommend checking the rewrite rules and excluding the sitemap files from caching.

    To exclude the sitemap_index.xml file from caching, you can follow these steps:

    1. Navigate to your caching plugin settings.
    2. Locate the option to exclude specific files from caching.
    3. Add the sitemap_index.xml file to the exclusion list.

    Additionally, ensure that the rewrite rules are correctly set up for Rank Math. You can refer to this knowledge base article for more information on fixing sitemap issues in Rank Math.

    If the issue persists after following these steps, please reply to this ticket, and a human agent from the Rank Math Support team will assist you further.

    Thank you for bringing this to our attention.

    Sources:
    Why the Sitemap_Index.xml is Throwing a 404 Error » Rank Math
    Rank Math Sitemap Issues and Their Fixes » Rank Math

    Anonymous
    Rank Math free

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Hello,

    Thank you for contacting us and sorry for any inconvenience that this issue might have caused.

    We can see that there is another sitemap generator on your site or perhaps on your site’s root directory see the sitemap at yourdomain/sitemap.xml (yourdomain should be replaced by your site’s URL).

    Rank Math’s sitemap is generated dynamically but there must be no physical sitemap at the root directory for it to be generated.

    Remove any physical sitemap on your root directory and if that is not the case disable the alternate plugin generating the non-Rank Math sitemap and then follow the steps below.

    1. Flush the Sitemap cache by following this video screencast:
    https://i.rankmath.com/pipRDp

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

    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.

    Anonymous
    Rank Math free

    the sitemap you are seeing is created after the delay in responding to my request, I deactivated the sitemap function from rankmath and used this new one located in the root of the website.

    Hello,

    Glad that everything has been sorted out.

    Please feel free to reach out to us again in case you need any other assistance.

    We are here to help.

    Thank you.

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

The ticket ‘sitemap post 404 error’ is closed to new replies.