Page sitemap giving 404 error in Google Search Console (looks fine in browser)

#667560
  • Resolved Anonymous
    Rank Math free

    Hi there,

    I’ve recently migrated over to Rank Math from Yoast and I’m having an issue with my new sitemap in Google Search Console.

    The /page-sitemap.xml is returning a 404 error in Google Search Console but it looks fine in the browser.

    The exact error showing is:
    Sitemap could not be read
    General HTTP error
    We encountered an error while trying to access your sitemap. Please ensure that your sitemap is present at the specified address and is not blocked to Google. See our help center for more debugging help.
    Examples
    HTTP Error:
    404

    I’ve tried to follow all documentation around flooding the cache etc. This worked for the rest of the sitemap but GSC is still refusing to read the page sitemap. They last tried to read it on October 23rd, so looks like they might’ve stopped reading it by now.

    Is there anything you can do to help?

    Many thanks,
    Justine

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

    I apologize for the issue you’re facing with your page sitemap in Google Search Console. I understand that the /page-sitemap.xml is returning a 404 error in Google Search Console, but it appears fine in the browser.

    This issue can occur due to various reasons, such as incorrect permalink structure, missing rewrite rules, or caching plugin conflicts. Since you’ve already tried flushing the cache and following the documentation, let’s try a few more troubleshooting steps to resolve this issue.

    First, please make sure that you have the correct permalink structure set up in Rank Math. You can check and update the permalink structure by navigating to Rank Math SEO → General Settings → Links.

    Next, ensure that you have the necessary rewrite rules in place for your server. If you’re using an NGINX or Apache server, please refer to our knowledgebase article on XML Sitemaps with NGINX or XML Sitemaps with Apache for detailed instructions.

    If you’re using a caching plugin, it’s important to exclude the page-sitemap.xml file from caching. This can be done within the settings of your caching plugin. If you’re unsure how to do this, please let me know which caching plugin you’re using, and I’ll provide you with specific instructions.

    If none of these steps resolve the issue, I recommend replying to the ticket and our Rank Math Support team will further investigate and assist you in resolving this problem.

    I apologize for any inconvenience caused, and we appreciate your patience and cooperation in resolving this matter.

    Kind regards,
    RankBot Support

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

    Anonymous
    Rank Math free

    Hi there,

    Okay, I have tried the following:

    – I cannot see a permalink setting in Rank Math SEO → General Settings → Links. Is this a paid for option only?
    – I reviewed your documentation about NGINX server and I can confirm that the sitemap does appear when I go to this URL: mydomain.com?sitemap=1 but I do not have a configuration warning in Rank Math like your documentation suggests I should see. Is this correct?
    – I have reviewed your Apache documentation and Google does not accept the URL: https://mydomain.com/?sitemap=1 The error says: Sitemap can be read but has errors > Your Sitemap appears to be an HTML page. Please use a supported sitemap format instead. Is this an issue?
    – I am using two caching plugins: Speed Optimizer by SiteGround and WP-Optimize. I can confirm all of the sitemap URLs are excluded from caching in both plugins.

    Does the above give you any more info as to what the issue with my sitemap might be?

    I noticed today that the entire sitemap was showing a 404 error (both in GSC and my browser), which was resolved when I clicked “Save settings” in the Permalinks section of WordPress. I’m not going to have to do this every few days, am I?

    Thank you in advance for any help you can give me on this.

    Best,
    Justine

    Anonymous
    Rank Math free

    Also, I can confirm that this website https://www.xml-sitemaps.com/validate-xml-sitemap.html shows no issues detected when I enter my sitemap URL into it.

    Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.

    Apologies for the confusion, but the permalinks settings would be on your WordPress dashboard > Settings > Permalinks.

    Please follow the steps to flush the sitemap cache:

    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/

    3. 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, you won’t need to do the steps everyday if you have already excluded your sitemap from caching.

    Hope that helps.

    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 ‘Page sitemap giving 404 error in Google Search Console (looks fine in browser)’ is closed to new replies.