How to Show the Last Modified Date of WordPress Post in SERP?

This post was last updated on April 5th, 2018 at 07:05 am

How to Show the Last Modified Date of WordPress Post in SERP (1)It’s a fast-moving digital world. No matter what product or service you are selling, people always want the latest information on it. But it’s not always possible to create new stories on a particular topic.

Content posted two years ago doesn’t necessarily mean that it’s no longer relevant. It could, in fact, be more beneficial than similar content published since then. But, because of its published date or lack of modification, it may lose some important interaction.

Search engines are regularly updated and change their algorithms. They also tend to deliver the latest information to users. Even a minor update in your content may influence search engines to rank you on top unless there’s related content from a high-authority site with a huge number of backlinks.

Therefore, you should always keep your information updated so that it continues to reach an audience.

What if you have nothing to update on your existing high-ranking post?

Are you going to just watch your rankdrop? Absolutely not. Consider writing fresh new content on the same topic and promote it on different platforms. But, will this action guarantee that it will get the same position in the SERPs? Probably not. Moreover, it’s a time-consuming process to rewrite all the content on your site just to get it re-indexed and ranked.

Congratulations if you are going to have a WordPress development service. You can solve this issue just by writing a few codes in your editor. Search engines will automatically display the recently modified date of all your posts. The code is as follows:

function display_last_updated_date( $content ) {
$original_time = get_the_time(‘U’);
$modified_time = get_the_modified_time(‘U’);
if ($modified_time >= $original_time + 86400) {
$updated_time = get_the_modified_time(‘h:i a’);
$updated_day = get_the_modified_time(‘F jS, Y’);
$modified_content .= ‘<p class=”last-modified”>This post was last updated on ‘. $updated_day . ‘ at ‘. $updated_time .'</p>’;
}

$modified_content .= $content;
return $modified_content;
}
add_filter( ‘the_content’, ‘display_last_updated_date’ );

Just log into your WordPress admin panel, click on the editor option in the left sidebar under “appearance”, find “function.php” and paste the code.

wordress backend

You are now done showing your posts’ last modified date in the SERPs. You now have regained user trust and the preferential treatment of search engines preference through this simple modification of your content.