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:
Then we add a conditional statement which only shows the date if the post is less than 90 days old:
1 2 3 | <?php if(strtotime( get_the_date() ) > strtotime( "90 days ago" )) { the_date(); } ?> |
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:
1 2 3 | <?php if((get_post_meta($post->ID, 'add-date', true)) || strtotime( get_the_date() ) > strtotime( "90 days ago" )) { the_date(); } ?> |
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!
24 Comments Leave a comment
Leave a comment

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?
Tim. This certainly isn’t our experience so far. We’ve seen a steep rise in Google traffic over the last couple of weeks!
Jimmy
OK, I think I’ll give it a go. Where exactly do you insert the code?
Hi Tim. You put the code in your single.php template, wherever you want the date to appear (or not appear!)
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.
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.
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.
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?
How to Remove Dates from SERP Snippets if it isn’t wordpress. my website isn’t wordpress but i have dates in website kkfashion.vn
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
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.
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
We got an overall increase from 8000 to 11,700 organic clicks per week after making the fix, so almost a 50% improvement.
Pingback: Should You Add Dates to Blog Posts and Articles – or Hide Them?
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?” [ http://www.famousbloggers.net/date-blog-posts.html/comment-page-1#comment-181615 ]
Thanks for the heads-up on this and the tutorial.
Sorry, no insight in response to your reader’s query.
Hey you should make this a plugin..? Why not, I’d use it.
Dan, and how to remove the date of the comments? The Google can use it too!
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.
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?
Both, I think, DT.
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
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.
Thanx a lot for great tip it really working for my new blog. I was not aware about it.