-
the generated sitemap is not being accepted from google
it states is a html though its a xml
-
Hello,
We apologize for the issue you are facing with your sitemap not being accepted by Google. It sounds like Google is detecting your sitemap as an HTML page instead of XML. Here are a few steps you can take to troubleshoot this issue:
-
Check the Sitemap URL: Ensure that you are submitting the correct XML sitemap URL to Google. The correct URL should be something like `https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap?hl=en&visit_id=638053748553428520-79289376&rd=1.
-
Verify the Sitemap Format: Make sure that your sitemap is indeed in XML format. The header of your XML sitemap should look like this:
If the header is incorrect or if there are any HTML tags present, it could cause Google to misinterpret the file.
-
Check for Plugin Conflicts: Sometimes, other plugins can interfere with how your sitemap is generated. You can use the Health Check plugin to check for conflicts.
-
Clear Cache: If you are using a caching plugin, clear your website cache and try resubmitting the sitemap in Google Search Console.
-
Disable Caching for Sitemaps: If you are using caching plugins like W3 Total Cache, you may need to add a filter to disable caching for sitemaps. You can add the following code to your theme’s
rank-math.php
file:add_filter( 'rank_math/sitemap/enable_caching', '__return_false');
If you continue to experience issues, please reply to this ticket with your site URL so we can assist you further. Thank you for raising this concern!
Sources:
Rank Math Sitemap Issues and Their Fixes » Rank Mathi checked to see if the sitemap is valid and its not. it said this: Errors
Incorrect http header content-type: “text/html; charset=UTF-8” (expected: “application/xml”)Hello,
Please share your sitemap URL so we can check and verify it as well. You can add it to the sensitive data section by editing your first post
It is completely secure, and only our support staff has access to that section.
Meanwhile, please follow these steps to flush your sitemap cache:
1. Flush the Sitemap cache by following this video screencast:
https://i.rankmath.com/pipRDp2. 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/Looking forward to helping you.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
your instructions worked. probmlem solved. thank you!
Hello,
Glad that helped.
Please feel free to reach out to us again in case you need any other assistance.
We are here to help.
Thank you.
-
You must be logged in to reply to this ticket.