-
Hello. i have a huge problem with Rank Maths with my website. Rank Math generating a dynamic xml sitemap https://www.publieremploi.fr/sitemap_index.xml. Fact is Google Search console no longer access this file seems because of x-robots-tag: no index. this is set in plugins/seo-by-rank-math/includes/modules/sitemap/abstract-xml.php by default. I try to put in my theme add_filter( ‘rank_math/sitemap/http_headers’, function( $headers ) { $headers[‘X-Robots-Tag’] = ‘all’; return $headers; })
-
Hello,
We apologize for the issue you are facing with your sitemap and the
noindex
X-Robots-Tag. It seems like there might be a conflict or misconfiguration that is preventing Google from accessing your sitemap.Here are a few steps you can take to troubleshoot and potentially resolve this issue:
-
Check Your Robots.txt File: Ensure that your
robots.txt
file does not have any rules blocking access to your sitemap. You can check this by going to Rank Math SEO → General Settings → robots.txt. -
Review Rank Math Settings: Make sure that the settings in Rank Math are configured correctly. You can check the Rank Math Metabox for the specific pages or posts to ensure they are set to index.
- Open the post/page in the WordPress Editor and check the Rank Math Metabox. Ensure that the Robots Meta is set to Index.
-
Clear Cache: If you are using any caching plugins, clear the cache to ensure that the latest changes are reflected.
-
Custom Code: The code snippet you provided should work to modify the X-Robots-Tag header. Ensure that it is placed correctly in your theme’s
functions.php
file or in a site-specific plugin. Here’s the code again for reference:add_filter( 'rank_math/sitemap/http_headers', function( $headers ) { $headers['X-Robots-Tag'] = 'all'; return $headers; });
-
Check for Plugin Conflicts: Sometimes, other plugins may conflict with Rank Math. You can use the Health Check plugin to identify any potential conflicts.
-
Resubmit Your Sitemap: After making these changes, remove your sitemap from Google Search Console and resubmit it as described in this tutorial.
If these steps do not resolve the issue, please reply to this ticket with your website URL so that a human agent from our support team can assist you further. Thank you for raising this concern, and we’re here to help!
Sources:
How to Fix Submitted URL Marked ‘NoIndex’ Error » Rank MathImpossible de lire le sitemap
Une erreur s’est produite lors de l’accès à votre sitemap. Veuillez vérifier que votre sitemap se trouve bien à l’adresse indiquée et n’est pas bloqué par Google. Consultez notre Centre d’aide pour d’autres conseils de débogage.
Exemples
Erreur HTTP :
404Le sitemap est un fichier HTML.
1 instance
Votre sitemap semble correspondre à une page HTML. Veuillez utiliser un format de sitemap pris en charge.
Exemples
Ligne 2
Tag :
htmlYour Version 1.0.249
Hello,
Please note that RankMath sets the “noindex” tag on your sitemaps by default. It’s done this way because a sitemap is only meant to guide search engines through your site, not to rank in search results.
The reason you’re seeing it set to “noindex” is to prevent it from appearing in search results, which is the desired behavior.
You should follow this guide to properly submit your sitemap:
https://rankmath.com/kb/submit-sitemap-to-google/However, if you still wish to remove the noindex tag from your sitemap, you can use the filter on your site:
add_filter( 'rank_math/sitemap/http_headers', function( $headers ) { if ( '/sitemap_index.xml' !== $_SERVER['REQUEST_URI'] ) { return $headers; } unset( $headers['X-Robots-Tag'] ); return $headers; } );
Here’s how you can add a filter/hook to your WordPress site:
https://rankmath.com/kb/wordpress-hooks-actions-filters/Looking forward to helping you.
Well I leave as it was
So : Version
1.0.249
Version de la base de données
1
Offre d’abonnement à l’extension
Free
Modules actifs
link-counter, analytics, seo-analysis, rich-snippet, local-seo, role-manager, sitemap
Jeton d’actualisation de Google
Le jeton existe
Droits de Google
Search Console: Accordées
Table de la base de données : journal des erreurs 404
32 Ko
Table de la base de données : redirection
Introuvable
Table de la base de données : cache de redirection
Introuvable
Table de la base de données : liens internes
96 Ko
Table de la base de données : métadonnées des liens internes
96 Ko
Table de la base de données : Google Search Console
176 Ko
Table de la base de données : Publications sans hiérarchie
192 Ko
Table de la base de données : Inspections
112 KoSearch console CONNECTED TO THE SITE DOMAIN PROPRIETY
add the sitemap url https://www.publieremploi.fr/sitemap_index.xml
Impossible de lire le sitemap
Erreur HTTP générique
1 instance
Le sitemap est un fichier HTML.One more try with
add_filter( ‘rank_math/sitemap/http_headers’, function( $headers ) {
if ( ‘/sitemap_index.xml’ !== $_SERVER[‘REQUEST_URI’] ) {
return $headers;
}
unset( $headers[‘X-Robots-Tag’] );
return $headers;
} );retry sitemap submission
Impossible de lire le sitemap
Erreur HTTP générique
1 instance
Le sitemap est un fichier HTML.So ?
page-sitemap.xml and post-sitemap.xml only accepted currently
Hello,
Please follow the steps below:
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. Apply the following filter code to your site.
add_filter( 'rank_math/sitemap/enable_caching', '__return_false');
Here’s how you can add filter to your WordPress site:https://rankmath.com/kb/wordpress-hooks-actions-filters/
4. Remove all your sitemaps from your Google Search Console and re-submit only the index sitemap (
https://website.com/sitemap_index.xml
)5. If the issue persists, please try removing all your sitemaps from your GSC account again and try submitting the following:
https://website.com/?sitemap=1
.Let us know how that goes. Looking forward to helping you.
I use no cache plugin nor CDN
However, il followed your procedureadd 201, resave sitemap cfg
htaccess
RewriteEngine On
RewriteRule .* – [E=Cache-Control:no-cache]add add_filter( ‘rank_math/sitemap/enable_caching’, ‘__return_false’); to my theme child function.php
resave permalinks
Go to GSC
remove any sitemap from url site as defined in Statistics Rank Math (not site propriety)
resubmit https://www.publieremploi.fr/sitemap_index.xml
error cannot recovered the sitemapHave a try with ?sitemap=1
error cannot recover the sitemapHello,
We ran several tests on your sitemap and subsitemaps and did not detect any issues:
Please note that when you submit your sitemap on GSC, it takes some time to crawl and process it fully.
Give Google some time to recrawl your sitemaps. You can monitor the “Last read/crawl date” column in the sitemap index as it will update the date when Google crawls your sitemap.
Let us know how it goes. Looking forward to helping you.
Thank you
Thanks
Yes wait and see.
I requested url indexation although soûls not and well accessibleHello,
You’re most welcome. Yes, waiting and monitoring how Google processes it should be your next move. Since the URLs are accessible and you’ve submitted them for indexing, things should gradually improve.
Let us know how that goes. Looking forward to helping you.
28 July :
/job_listing_type-sitemap.xml Inconnu 28 juil. 2025 Impossible de récupérer le sitemap 0 0
/event_listing_type-sitemap.xml Inconnu 28 juil. 2025 Impossible de récupérer le sitemap 0 0
/event_listing_category-sitemap.xml Inconnu 28 juil. 2025 Impossible de récupérer le sitemap 0 0
/job_listing-sitemap.xml Sitemap 28 juil. 2025 25 mars 2025 Impossible de récupérer le sitemap 10 0
/event_organizer-sitemap.xml Inconnu 28 juil. 2025 Impossible de récupérer le sitemap
/event_listing-sitemap.xml Inconnu 28 juil. 2025 Impossible de récupérer le sitemap
/page-sitemap.xml Sitemap 28 juil. 2025 24 juil. 2025 Opération effectuée 14 0
/post-sitemap.xml Sitemap 28 juil. 2025 24 juil. 2025 Opération effectuée 1 0
/sitemap_index.xml Inconnu 28 juil. 2025 12 juil. 2025 Impossible de récupérer le sitemaponly /page-sitemap.xml Sitemap 28 juil. 2025 24 juil. 2025 Opération effectuée 14 0
/post-sitemap.xml Sitemap 28 juil. 2025 24 juil. 2025 Opération effectuée 1 0No solution for me actually
main sitemap also very important as sometimes rankmap generate new sitemap if link over quota
I prefer not submit manually and obviously here this doesn’t workSo where does’t it come from ? xml ? xsl included ? See xsl header cache-control maxage ? should le be max-age ? provider error ?
Please help, advise.
For my concern.
So
# BEGIN Rank Math
<IfModule mod_rewrite.c>
RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 [L]
</IfModule>
# END Rank Math Sitemap Rewrite Rules# BEGIN: Forcer no-cache via variable d’environnement
<IfModule mod_rewrite.c>
RewriteRule .* – [E=Cache-Control:no-cache]
</IfModule>
# END# BEGIN Headers – XML & XSL Sitemaps
<IfModule mod_headers.c>
<FilesMatch “sitemap.*\.xml$”>
Header unset X-Robots-Tag
Header set Content-Type “application/xml; charset=UTF-8”
</FilesMatch><FilesMatch “main-sitemap\.xsl$”>
Header unset X-Robots-Tag
</FilesMatch>
</IfModule>
# END Headers – XML & XSL SitemapsIn theme function
// Désactive le cache interne des sitemaps XML générés par Rank Math
add_filter( ‘rank_math/sitemap/enable_caching’, ‘__return_false’ );add_filter( ‘rank_math/sitemap/xsl_headers’, fn($h) =>
array_merge(array_diff_key($h, [‘X-Robots-Tag’ => ”]), [
‘Cache-Control’ => ‘max-age=86400’
])
);Submit to GSC ?sitemap=1
ok read. some errors remains with sub sitemaps. resubmit manually ok. remain a problem with this one https://www.publieremploi.fr/job_listing-sitemap.xml. asking for inspection reindex. waiting for…
Hello,
We tested them using https://www.xml-sitemaps.com/validate-xml-sitemap.html and also checked their HTTP status using https://httpstatus.io/.
Please do not hesitate to let us know if you need our assistance with anything else.
Submit ?sitemap=1 solved the problem
.htaccess
# BEGIN Rank Math
<IfModule mod_rewrite.c>
RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 [L]
</IfModule>
# END Rank Math Sitemap Rewrite Rules -
You must be logged in to reply to this ticket.