How to Remove Dates from SERP Snippets in WordPress to Increase Clickthrough Rate

Ben posted recently about how removing the date from SERP snippets on older posts helped us recover a lot of traffic we had inadvertently lost several months previously.

In this tutorial I’ll show you how we removed the dates, and set up an option to keep the dates in for ‘time-sensitive’ posts.

Why remove the date?

First things first, why would we want to remove the date from the SERP snippet at all?

As Ben explained in his article, if someone sees your post in the search results, but it is dated several years ago, they are much less likely to click through to the page, as they may assume that the information there will be out of date.

This is fair enough for searches that are ‘time-sensitive’, for example if you’re searching for recent news, you don’t want to read articles from last year. This is why we added an option to keep the date if desired (which I will explain later).

But certain types of post are ‘timeless’ and would be as relevant today as they were 5 years ago. For example Ben’s article about why you should code by hand. The article was written in 2006, but the message is still relevant today, therefore we would choose not to display the date on this post, in case people wrongly assume that the content will be out of date.

At the same time, if a search result shows a recent date, then this is more likely to encourage clickthroughs, which is why we only remove the date after the article is three months old.

Where does Google get the date from?

To remove the date from the SERPs, we need to know where Google gets it from in the first place. I read a number of different articles on the subject, which said that Google can find the date on a WordPress post from the the_date() function, or failing that, from the date of comments or the content of the post itself.

However, looking at the page source, I found that the only place the full date appeared was directly after the main heading, from the the_date() function, so I figured removing this should be sufficient.

How to keep the date

We decided that more often than not, we would want to hide the date, so we made that the default. But as I mentioned earlier, we wanted an option to keep the date on a post if we felt readers would benefit from knowing the date of publication.

We do this through a custom field, which I’ll call add-date. So if you want to keep the date, you add the add-date custom field, and give it a value (any value will do, as we will only check whether the field exists or not, but for the sake of consistency I use a Y as the value).

Note: If you prefer, you can add a meta box to the Edit Post page and make this custom field into a checkbox, as pictured below. If you don’t know how to code that, the Custom Fields plugin makes it very simple.


How our 'Add date' option appears in the post editor

Making it work

Now all we need is a bit of PHP to make it all work.

We start with the date function:

<?php the_date(); ?>

Then we add a conditional statement which only shows the date if the post is less than 90 days old:

<?php if(strtotime( get_the_date() ) > strtotime( "90 days ago" )) {
} ?>

And finally, we add another condition, so that if the post is less than 90 days old OR our add-date custom field exists, then the date is shown:

<?php if((get_post_meta($post->ID, 'add-date', true)) || strtotime( get_the_date() ) > strtotime( "90 days ago" )) {
} ?>

And that’s it! You can change the 90 days bit to whatever time period you prefer.

The verdict

So within about a week of implementing this, the dates had gone from all of our selected SERP snippets, and as shown in Ben’s article, our traffic is on the rise. Yay!

30 Comments Leave a comment

  1. Tim says:

    Since google have stated that they think the date is useful to users and that’s why they are going to show it, is there a chance that they will penalize you if you deliberatley remove a piece of data that they have decided should be displayed?

    • Jimmy Hughes says:

      Tim. This certainly isn’t our experience so far. We’ve seen a steep rise in Google traffic over the last couple of weeks!

      • Tim says:

        OK, I think I’ll give it a go. Where exactly do you insert the code?

      • Dan Johnson says:

        Hi Tim. You put the code in your single.php template, wherever you want the date to appear (or not appear!)

  2. Jeremy Ringsmuth says:

    I read Ben’s article the other day, but it has me a bit miffed. This is a valid approach to the problem, but is it the best holistic approach? If there is useful content in an article that appears outdated on the SERP, why not write an updated article linking to the original, providing any useful updates or modifications to that content. It will have a fresh date, it will continue to provide useful information as well as meaningful dates and it will only add to the sites credibility over time. I fear the hesitation would be regarding the extra work. It is the extra effort, on behalf of the users, that Google honors and will ultimately increase your credibility. Google will get wise to ‘date hiding’ soon enough.

    • Dan Johnson says:

      You’re right Jeremy, if an article is out of date, the best thing to do is write an update, as we did last year after many complaints that Ben’s Top 10 best designed websites post was very outdated.

      We’re not trying to trick people into reading outdated posts, just trying to avoid putting people off unnecessarily.

  3. Dan Johnson says:

    One thing I forgot to mention is that the dates still display on archive and index pages, so visitors navigating your site will still be able to see the date of a post.

  4. Mike says:

    I’m trying to build the exact CUSTOM FIELD that you have there. I’m a little lost and the CUSTOM FIELD plugin page is little use. Unless it takes a massive explanation (I’m sure you guys are busy), where does one copy the above php code in the CUSTOM FIELD plugin?

  5. K&K Fashion says:

    How to Remove Dates from SERP Snippets if it isn’t wordpress. my website isn’t wordpress but i have dates in website

  6. Hadi says:

    This doesn’t seem to work anymore – the SERP that led me to this post has a date of 1 July 2011 before the snippet…

    I’m going to investigate further

  7. Imran Soudagar says:

    Thanks for the useful information. Although this article is useful to me but in Google search I have seen a blog which displays today’s date for every article. I had searched many articles. I want to know how he does. I could have provided the link but I have forgotten it.

  8. Saurabh Mukhekar says:

    Nice tips,btw what is the impact of removing all these dates,coz google know when that content got crawled and they have some data associated with that link

    • Ben Hunt says:

      We got an overall increase from 8000 to 11,700 organic clicks per week after making the fix, so almost a 50% improvement.

  9. Pingback: Should You Add Dates to Blog Posts and Articles – or Hide Them?

  10. Vernessa Taylor says:

    Hi Dan and Ben,

    I’ve just written a post over on Famous Bloggers referencing your tutorial (here) and the article detailing your “Google slap.”

    Until I read your articles, it never occurred to me to remove the date for the SERPs. A question posed by a commenter on my article could possibly be answered by one of you: “[D]o you know what impact the PHP code has (if any) when the date range is selected in Google search?” [ ]

    Thanks for the heads-up on this and the tutorial.

    • Ben Hunt says:

      Sorry, no insight in response to your reader’s query.

  11. Ben Racicot says:

    Hey you should make this a plugin..? Why not, I’d use it.

  12. Fernando says:

    Dan, and how to remove the date of the comments? The Google can use it too!

    • Ben Hunt says:

      You may need to hack single.php (for pages), possibly index.php, and most likely comments.php.

      Look for where it say the_time(), a WordPress function that prints the current time, and comment it out.

  13. DT says:

    So if I understand this correctly, this will simply review the date from the SERP (that usually appears next to the meta desc) and not from the actual post itself?

  14. Mimi says:

    Hi, excellent. Now, I would want to know a way to NOT show the date on the comments section.
    How can I remove the date in comments?

    My theme is a little bit freaky, I can’t find a way :(

  15. Lionel says:

    I don’t think that Google will penalize if we remove the date from the Google serp. Some times it seems to me that showing date is beneficiary for trust issues.

  16. sunil says:

    Thanx a lot for great tip it really working for my new blog. I was not aware about it.

  17. KJ says:

    Strange but true….The date appears in the snippet for this page when I queried “remove date from wordpress search engine listing”

    Have you guys decided to add the date back in?

  18. Pingback: Hiding the Dates on Older WordPress Posts

  19. Subhash says:

    Its nice,even i moved from blogger to wordpress for this mainly blogger has the same disadvantage using date to index.If a competitor post the same article duplicate my post after i had published then he has the advantage of recent article or updated article and it gain in SERP.
    Can you help how can we add update tag to post in wordpress blog as in webmaster tools while using the richsnippets tool,it displays that updated tag missing.
    But the above post was very usefull and nice.

  20. Shannon Hutcheson says:

    So the only way I can “see” results is in the SERPs? As the date change doesn’t actually show on my site itself.

    I’m trying your hack by adding it via Genesis’ simple hooks. Hoping it works but with no real way to see results. Kind of confusing. :)

  21. BSD says:

    I think it’s more than a little ironic that the date that your article was posted appears in the Google SERP. Google eventually figures out an end-around for any attempt to fool it. This is true of nearly every first-page result returned for my search, so it’s not really a criticism of your method.

  22. Pingback: How to increase Google Search CTR ?: Best tricks