Hello,
Thank you for contacting Rank Math support and we apologize for the inconvenience.
Rank Math does not have a feature that lets you choose when to update the modified date of your posts. However, there are some ways to work around this problem.
Google uses the modified date from your content and your structured data to determine how fresh your posts are. If you want to prevent Google from seeing the modified date, you need to remove it from both places.
To remove the modified date from your structured data, you can add a filter code to your website. This code will unset the dateModified
property from your article schema. Here’s the code you need to add:
add_filter( "rank_math/snippet/rich_snippet_article_entity", function( $entity ) {
unset( $entity['dateModified'] );
return $entity;
});
To remove the modified date from your open graph metadata, you can add another filter code to your website. This code will disable the og:updated_time
and article:modified_time
tags from your Facebook metadata. Here’s the code you need to add:
add_filter( 'rank_math/opengraph/facebook/og_updated_time', '__return_false');
add_filter( 'rank_math/opengraph/facebook/article_modified_time', '__return_false');
To remove the modified date from your sitemap, you can add a third filter code to your website. This code will remove the lastmod attribute from your sitemap index entries. Here’s the code you need to add:
/**
* 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 );
You can also block search engines from accessing your feeds, which may contain the modified date. To do this, you can add a rule to your robots.txt file that disallows crawling of your feed URLs. Here’s the rule you need to add:
User-Agent: *
Disallow: /feed/
These steps should help you remove the modified date data from your website completely. However, you should also make sure that your theme does not display the modified date in your content. If it does, you should contact your theme developer and ask them how to remove it.
We hope this helps you resolve your issue. Thank you for choosing Rank Math as your SEO plugin.