Hello, we apologize for the inconvenience you’re facing. It seems that you’re trying to remove the last modification date from your XML sitemap. We recommend using the filter provided in our guide to remove the lastmod date from your sitemap index. Here’s the filter you can use:
/**
* Filter to remove lastmod from sitemap index
*/
add_filter( 'rank_math/sitemap/index/entry', function( $index, $type ) {
if ( isset( $index['lastmod'] ) ) {
unset( $index['lastmod'] );
}
return $index;
}, 10, 2 );
If you’ve already used this filter and it’s not working as expected, please ensure that it’s correctly added to your theme’s functions.php file or a custom plugin. If the issue persists, please provide us with more details about your setup so that we can assist you further.
Sources:
Indexed, Not Submitted in Sitemap – Google Search Console » Rank Math
How to Configure Sitemaps in Rank Math – Best Settings and Tips
How to Remove Date Snippets from Search Results » Rank Math
Hello,
Thank you for contacting Rank Math support.
We have already replied to your other ticket with the same concern, and please continue there to avoid duplication.
I’ll close this one so we can follow up on one thread for efficiency.
Looking forward to helping you.
Thank you.