With Google’s freshness algorithm in place, you have to feed your blog with fresh content consistently. This helps to keep your visitors happy and also, strongly forms a basement to grow your blog.

You know Google shows the publish date on the search results page (SERP).

Problem-I  (showing date on old published blog posts):

  • For new blog posts which are recently published may have a positive effect on the Google’s SERP. Searchers may click on your fresh URL more often.
  • However, for a blog post published long back (say, 3 or 4 years back) may not have the same positive effects on the SERP. Searchers may not click on old or outdated URLs.

Solution to Problem-I:

Problem-II  (showing date on outdated and old blog posts):

  • For blog posts that are not updated for long time.
  • For example, in my blog there are articles still showing the last modified date of 6 years back.
  • This badly affects CTR on the SERP.

Solution to Problem-II:

  • Disable dates on these older and outdated (non-updated) blog posts.
  • And, you can show the last modified date only on the blog posts which are recently modified.

The advantage:

  • You will be showing date on blog posts which are recently published & also, those which are recently modified.
  • You will not be showing date on blog posts which are outdated.

For example:

  • You can set up to show date only for all the blog posts which are modified after 2014.
  • And, disable date on blog posts which are not modified after 2014.

Source Code to Disable Date only on Older & Out-dated Blog Posts.

<?php
$modified_year = get_the_modified_date();
$modified_year = date(‘Y’, strtotime($modified_year));
if (intval($modified_year) > 2014)
{
echo “Last updated on “; the_modified_time(‘F jS, Y’); echo ” by <em>”; the_author(); echo “</em>”;
}
else
{
echo “by <em>”; the_author(); echo “</em>”;
}
?>

The Proof:

You can just copy the above source code and use it on Single.php where your theme is already showing the post publish date.source code

Hope the source code helps you to disable date on Google’s result page for older/outdated blog posts.

Let me know, if you have any doubts in using this source code.

2018-03-06T18:13:55+00:00

About the Author:

I love-to-code, passionate-to-write, an upcoming author, and WordPress enthusiast. Here at BlashO, I mostly share WordPress tips. Connect with me @Twitter.

4 Comments

  1. Thank you so much for this post. This is exactly what I’m looking for. I’m trying to show “Last updated” date on Google search results.

    • Ven Tesh - Reply

      Nice to hear that it helped you Niki, See you back.

  2. MKDan - Reply

    How to use this in Genesis theme?

    • Ven Tesh - Reply

      You may have to edit the post template, something like this or this in order to change in genesis theme.

      In case, if you are not comfortable in editing the theme files, better try a plugin like Wp last modified.

      Thanks.

Leave A Comment