Hello,
We apologize for the inconvenience you are facing with the robots.txt file and the sitemap URL issue in Google Search Console. We understand the importance of resolving this matter promptly.
The error message you are seeing, “Invalid sitemap URL detected, syntax not understood (line 7)” typically indicates that there is an issue with the sitemap URL you have submitted to Google.
To resolve this issue, please ensure that you have submitted the correct XML sitemap to Google. You should submit the sitemap available on your website at `https://rankmath.com/wp-content/uploads/2023/05/Confirm-the-latest-robots.txt-file-is-displayed.png
If you are sure you have submitted the correct URL but are still facing this error, you can check for a plugin conflict using the Health Check plugin. Additionally, if you are running W3 Total Cache along with Rank Math on your website, you can create another user agent group and add the ‘_googlebot’ user agent to it.
If none of these solutions help resolve the issue, you can include a filter in your theme’s functions.php or rank-math.php file:
add_filter( 'rank_math/sitemap/enable_caching', '__return_false');
If you need further assistance, please feel free to reach out to our support team, who are available 24/7 and ready to help.
We hope this information helps resolve the issue. Thank you for reaching out to us.
Sources:
Rank Math Sitemap Issues and Their Fixes » Rank Math
How to Fix ‘Blocked by robots.txt’ Error in Google Search Console » Rank Math
Common robots.txt Issues & How to Fix Them » Rank Math
How to Add Sitemaps to Robots.txt » Rank Math
Hello,
Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.
It seems like a new glitch on Google Search Console and many people already faced the same issue. However, it shouldn’t cause any indexing issues on your website. For more details, you can check this thread: https://support.google.com/webmasters/thread/246133059/error-invalid-sitemap-url-detected-syntax-not-understood-line-3?hl=en
Hope that helps and please don’t hesitate to let us know if you have any other questions.
Â
Thank you.
hi. This is a problem from Google and many sites are faced it. You just need to know that displaying Allow at the beginning of the map is not correct and Google should fix it
its wrong:
Allow: sitemap: https:www.sample.com/sitemap_index.xml
user agent googlebot not support https:www for Allow
https://developers.google.com/search/docs/crawling-indexing/robots/create-robots-txt
Hello @alirezanaji,
Thank you so much for reaching out and I appreciate your input about the right syntax for allowing sitemap via robots.txt
Don’t hesitate to get in touch with us if you have any other questions.