Sitemap 404 not found. Showing as HTML in Google Console

#842587
  • Resolved Heartland Art Club
    Rank Math free

    We received an error message from Google telling us that we had a sitemap error. I think the XML page is somehow missing, so Google is trying to read the HTML version that we have published on our website.

    The error message is: The sitemap can be read but has errors. Your Sitemap appears to be an HTML page. Please use a supported sitemap format instead.

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

    We apologize for the issue you are facing with your sitemap. The error message you received indicates that Google is trying to read your sitemap but is encountering an HTML page instead of the expected XML format. This can happen for a few reasons:

    1. Incorrect Sitemap URL: Ensure that you are submitting the correct sitemap URL to Google Search Console. The correct URL should be something like `https://rankmath.com/kb/sitemap-404-error/#index.

    2. Plugin Conflicts: Sometimes, conflicts with other plugins can cause issues with the sitemap. You can check for plugin conflicts using the Health Check plugin.

    3. Caching Issues: If you are using a caching plugin, it might be serving a cached version of an HTML page instead of the XML sitemap. Make sure to exclude the sitemap files from being cached. You can find more information on how to do this in our article about excluding sitemaps from caching.

    4. Custom Canonicals: If you have set custom canonical URLs for your posts, they may not appear in the sitemap. Ensure that all posts are set to index and consider removing any custom canonicals if you want them included in the sitemap.

    5. Sitemap Rewrite Rules: If you are using an NGINX or Apache server, ensure that the correct rewrite rules are in place. You can refer to our guide on adding rewrite rules for Rank Math sitemaps for NGINX or how to edit your .htaccess file for Apache.

    If you have checked all these points and the issue persists, please reply to this ticket, and a human agent from the Rank Math Support team will assist you further.

    Thank you for raising this concern!

    Sources:
    Troubleshooting the “Couldn’t Fetch” Error in Google Search Console » Rank Math
    Rank Math Sitemap Issues and Their Fixes » Rank Math

    Hello,

    Thank you for contacting Rank Math support.

    Google is showing that error because your sitemap is currently redirecting to your homepage, which is an HTML page.

    Please follow these steps to flush and regenerate your sitemap: https://i.rankmath.com/pipRDp

    We are looking forward to hearing back from you.

    Thank you. That worked. Any idea how that happened? We haven’t changed anything relating to the sitemap for months.

    Hello,

    There’s a good chance the error is related to your sitemap being cached. You can follow this guide to exclude your sitemap from being cached: https://rankmath.com/kb/exclude-sitemaps-from-caching/

    Also, add this code to your website to disable the sitemap transient caching:

    /** 
     * 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');

    You can learn how to add this code to your website here: https://rankmath.com/kb/wordpress-hooks-actions-filters/

    We hope this helps you resolve the issue. Don’t hesitate to contact us again with any other questions or concerns regarding Rank Math. We are always happy to help.

    Thank you for choosing Rank Math!

    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 ‘Sitemap 404 not found. Showing as HTML in Google Console’ is closed to new replies.