How to remove your WordPress post date stamp from Google SERPS

wordpress blog serps timestamp

Just about every WordPress blog theme displays the date a post was published which can be useful to your readers, if the date isn’t relevant to your posts however it can be disruptive to the appearance of your content is Google’s SERPS.

By using javascript instead of php code ( as is standard in WordPress themes ), the date/time will be shown in the exact same fashion as your current theme, but Google will ignore that piece of information and not show the date stamp before your meta description in the SERPS. Here’s how you make the change.

On most WordPress themes the 3 files you will need to update is your index.php to update your homepage, single.php to update your individual posts and archive.php to update your archives if you index them. More files may need updating depending on your theme. As always if your not 100% sure what you’re doing back-up your theme before making any changes.

Head into the appropriate file and find the php code which inserts the date with each post, it will look something like this:

<?php the_time('F jS, Y') ?>

Replace the code with the following:

<script language="javascript" type="text/javascript">document.write("<?php the_time('F jS, Y') ?>");</script>

The change will turn this:

Into this:
remove serps time stamp

Much better!

Now you should be free to make the most of the limited and valuable space available for your pages meta descriptions, without the date stamp getting in the way.

The change won’t be instant of course, but your root level page should update quickly while your remaining posts will update over the next few days/weeks depending on how often Google crawls your page.

14 thoughts on “How to remove your WordPress post date stamp from Google SERPS”

  1. Loving your work, going to give this a try on my site, have been searching for a way to do this and yours is the first article that seems to have a clue!

  2. Hi Ewan,

    Glad to be of service.

    Personally I think that it’s a huge improvement to not show the date in front of the meta description. Having recently implemented this myself I’ll be interested to see how it affects my click through rate over the coming weeks/months.

  3. Well having not had the time to implement this yet, however being a regular searcher of answers to many different types of questions I’m sure it has already made a difference to your click through rate?

    I know when I see search results, especially when im looking for something ‘technology’ related (no matter how new the ‘technology’ is) I often ignore the results that are 2, 3, 4 or more years old – even if they could be relevant – just because of their age.

  4. Ewan,

    I plan to do a follow up post in a few weeks so we’ll soon see, but I expect you’re correct.

    I think your comment about ignoring results that are years old is spot on for a lot of people, and the date stamp is a liability for websites like mine where the content isn’t time sensitive.

  5. Hello Andrew,

    In the Archives.php should I leave this as is?

    I have changed the Archive.php, Index.php and single.php posts
    with the code.


  6. Chris,

    Without seeing your theme I can’t say 100%, but typically yes.
    You would change “archive.php”. There would be nothing to change in “archives.php”

    Regarding your comment, if you tried to leave php code in the comment WordPress strips it out due to security.

    I’ve emailed you, if you’d like to reply with the code in question I’d be happy to have a look for you.

  7. Finally! A real answer to my question. So glad I found this article. Just so you know I found it on digg in the SERPS right above a post that had [Mar 16, 2002] in their serp. I thought that was kind of ironic!

  8. Andrew! I’ve been reading quite a lot of articles tonight about the date stamp issue, but you’re the only one who gave a clear information, straight to the point. Bookmarked and thanks!

  9. Hey Andrew,

    I’ve been looking all over for a solution to this, but still cannot remove the time stamp from my Google SERP/Meta description. I’m pretty sure this is hurting conversions.

    I am using WP Thesis. I can’t find the correct file to edit. I see an, but there is nothing like the

    Nothing like that in index.php either.

    Any ideas?

    Thanks for your help!

  10. Bellaisa,
    I wasn’t here back in 2002, so that’s definitely wrong.

    No worries at all. Glad to be of assistance.

    I’m afraid I’m not familiar with the Thesis theme, I could’t say specifically where else the datestamp code might be.

    It may be calling another .php file with the datestamp code, instead of it being in the files like single.php themselves, though the code " < ?php the_time('F jS, Y') ?> " should still be the same. It’s just a matter of finding it.

    Do you have Adobe Dreamweaver? When I’ve had trouble finding where a piece of code in the past, I loaded all the files from the theme into Dreamweaver and do a search for it. Dreamweaver has an option to search all open documents, so you don’t need to manually go through dozens of files to find it.

    Do a search for " < ?php the_time( " just in case the date format is different, and that should find it.

    I hope that helps?

  11. Can removing the date stamp from Google cause any penalty? I mean suppose I posted content and the next day another website posted same thing, then how google can make distinguish from both in absence of date mark?

  12. Hi Tushar,

    I assume you’re thinking of cloaking? Which this is not. You’re delivering the same date information to all visitors/spiders, except that Google doesn’t (at the time of writing) use the information in javascript.

    Google uses its own methods of determining the date, regardless of the date stamp anyway. If you search the Google Webmaster channel on YouTube, you’ll find Matt Cutts explaining that they don’t use the date as 100% because there is the potential for people to exploit this and make there information appear fresher.

    If you post the content first and your page is being regularly crawled, you should be credited with the content creation. Not the site that scraped you the following day. Hope that helps.

Comments are closed.