-
Hi, my google tag has not been detected in my sitemap by Google Tag Manager and it is detected as an error in Google console. How can I correct this ?
Thanks for your help
Maryse
-
Hello,
We apologize for the issue you are facing with your Google Tag not being detected in your sitemap. To troubleshoot this problem, we recommend following these steps:
1. Validate Your Sitemap
Ensure that your sitemap is correctly configured. You can use the Validate XML Sitemap tool to check for any issues. If your sitemap is valid, it should return a "No issues detected" message.
2. Ensure the Sitemap is Located in the Root Folder
Make sure your sitemap is located in the root folder of your WordPress installation. The URL should look like this:
https://yourdomainname.com/sitemap_index.xml
3. Check Your Posts’ Index Settings
Ensure that your posts are set to index. Go to Rank Math SEO → Titles & Meta and make sure the Index checkbox is enabled in the Robots Meta settings.
4. Flush the Cache
If your sitemap appears outdated, you may need to flush the sitemap cache. Navigate to Rank Math SEO → Sitemap Settings, increase the value of Links Per Sitemap by one, and save your settings. Then, go to Settings → Permalinks and click Save Changes.
5. Exclude the Sitemap From Caching
Make sure your sitemap is not being cached by any caching plugins. You can refer to this tutorial on excluding sitemaps from caching.
6. Add the Correct Sitemap to Google Search Console
Once you’ve ensured everything is set up correctly, add your sitemap URL to Google Search Console under Indexing → Sitemaps and click SUBMIT.
If you continue to experience issues after following these steps, please reply to this ticket with your site URL so we can assist you further. Additionally, if you would like a more comprehensive setup or troubleshooting, consider our professional setup service available at Rank Math Services, which requires a PRO subscription.
Thank you for raising this concern, and we hope these steps help resolve the issue!
Sources:
Troubleshooting the “Couldn’t Fetch” Error in Google Search Console » Rank MathHello,
My sitemap is detected by Google but I have an error in GTM : there is no Google tag in my sitemap. Can you help me ?Hello,
Thank you for contacting Rank Math support.
Please note that Google Tag Manager (GTM) is meant to be used to preview your website URLs, but not the sitemap itself.
Sitemaps are XML files for search engines and primarily help search engines discover URLs. They don’t contain tracking scripts like the Google tag or GTM code, nor should they.
So, if GTM is reporting that your sitemap doesn’t contain the tag, that’s not an error; it’s expected behavior. The sitemap is not meant to include any tracking code.
Meanwhile, since the Google Search Console is also reporting an error with the sitemap, please try to follow the steps below and see if that works for you.
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. If the above steps don’t seem to work, kindly apply the following filter to your site.
add_filter( 'rank_math/sitemap/enable_caching', '__return_false');
Here’s how you can add filter/hook to your WordPress site:
https://rankmath.com/kb/wordpress-hooks-actions-filters/Once done, clear your website cache, remove all the submitted sitemaps, and resubmit only the index sitemap in the Search Console.
Let us know how it goes. Looking forward to helping you.
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.
The ticket ‘Google Tag is not detected in my sitemap’ is closed to new replies.