Hello,
Thank you for contacting Rank Math and bringing your concern to our attention.
You can use and modify this filter to add some logic to tell the plugin where to get this value from:
add_filter( 'rank_math/snippet/rich_snippet_review_entity', function( $entity ) {
global $post;
$entity['dateModified'] = $post->post_modified;
return $entity;
}, 10, 1 );
Once done, it should be added to your theme’s functions.php file.
I hope that helps. Thank you, and looking forward to your update.
So is this schema markup where Google will display the last updated date? Or will they continue to show the published date on SERP results?
Hello,
Thanks for getting back. Sorry for the delay and any inconvenience that might have been caused due to that.
Yes, that filter will add the dateModified to your schema markup but it’s completely up to Google if they pick up your datePublished or dateModified to display in the search results.
You can also refer to the following article for more info about this: https://rankmath.com/kb/remove-dates-from-search/#how-google-picks-the-date
Hope this helps. Let us know if you need any further assistance.
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.