Article freshness is an important aspect of maintaining a site. Too many of them focus on churning out new content, without a care for updating old posts and pages. Some content of course, is evergreen. “How to” articles are a great example. You’ll find a whole bunch of them here on the NameHero blog!
But others like best deals, special offers, event description, product review etc are all related to freshness. No one wants to read a review of a product that’s two years old. This is especially important if you include the year or the date in your review! It won’t do to simply change the title to the new year every 12 months. The content itself needs to be refreshed and updated with the latest information.
We know that even Google takes cognizance of this. Every so often, you’ll see search results with a “Last Updated” tag next to it. It’s an example of the “rich results” feature of Google. The richer the results you get, the higher the chances of visitors noticing and clicking through.
We Need to Let Google Know
But it’s not enough to merely update your articles. We need to ensure that Google knows that we’ve done so! If you’re using proper schema markup, you probably already have a “date published” snippet in your HTML. So Google knows when the article was first created. But we can also include the date when it was modified. And that’s equally important.
We also want to display this near the top of our posts so that the user can note the freshness. Like this:

And when properly done, we can mark it up so that it shows up as structured data in Google’s structured data testing tool like so:

The following steps will show you how to implement this.
Adding the Modified Date above the Post with Structured Data
Open up your functions.php file and add the following code:
function append_updated_time( $content ) {
$updated_date = get_the_modified_time('F jS, Y');
$updated_time = get_the_modified_time('c');
$custom_content .= 'Last updated on '. $updated_date . '
';
$custom_content .= $content;
return $custom_content;
}
add_filter( 'the_content', 'append_updated_time' );
If you don’t know how to add code like this, you can check out the NameHero knowledgebase for a complete tutorial on how to add code snippets in WordPress.
The code above does two things:
- It gets the last modified date from the WordPress database and pastes it above the content. This way, everyone can see when a post was last modified.
- It adds in structured data markup that can be picked up by robots.
The latter is done using the <time itemprop=”dateModified”…> tag. This HTML is invisible to users, but visible to search bots. When they see it, they can parse it properly and know when a post was updated.
Then they can either choose to show it in their search results, or take it into account for ranking purposes, or whatever. Personally, I’ve found that search engines tend to give a little more love to frequently updated page. This isn’t a scientific observation, just an impression. It could also mean that frequently updated pages are better pages in general, but I can’t be sure.
So if you have a site with a lot of articles, it’s good to take a few minutes to add this code to your WordPress installation. It provides users with a visual indication of the freshness of an article, and it assists search engines to better evaluate your page for ranking purposes!

I’m a NameHero team member, and an expert on WordPress and web hosting. I’ve been in this industry since 2008. I’ve also developed apps on Android and have written extensive tutorials on managing Linux servers. You can contact me on my website WP-Tweaks.com!
Ah, this is helpful and good to know in WordPress–but is there a way in good ol’ PHP without the WP dependancies?
How to show last. Updated date in google search results for blogger platform blog
I think it makes sense to periodically update all of your articles. Add content and update the date. Google loves this and the position of the article will only improve.