How to remove your WordPress post date stamp from Google SERPS

. Both comments and pings are currently closed.

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:
timestamp

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 thoughtful comments on “How to remove your WordPress post date stamp from Google SERPS”

  1. Ewan says:

    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. Andrew Keir says:

    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. Ewan says:

    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. Andrew Keir says:

    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. Armand says:

    This was exactly what I was looking for, for my blog.

    Thanks Andrew.

  6. Chris says:

    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.

    Thanks,
    Chris.

  7. Chris says:

    Strange, you didn’t get my whole comment?

  8. Andrew Keir says:

    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.

  9. Bellaisa says:

    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!

  10. Sandro says:

    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!

  11. Gregg says:

    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 archiveS.com, but there is nothing like the

    Nothing like that in index.php either.

    Any ideas?

    Thanks for your help!

  12. Andrew Keir says:

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

    Sandro,
    No worries at all. Glad to be of assistance.

    Gregg,
    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?

  13. Tushar says:

    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?

  14. Andrew Keir says:

    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.


PLEASE NOTE: To prevent spam, your first comment will be moderated so there may be a short delay before it appears. Feel free to leave your thoughts on multiple posts, and they will all appear in no time.

Start your graphic design project
Subscribe and connect

LinkedIn Google+ RSS Email

Topics of discussion

Sitemap.

www.andrewkeir.com is owned and operated by Urizen Media Pty Ltd ACN 166 463 627.

Copyright©. All rights reserved. Graphic designer Melbourne. Logo designer Melbourne. Branding, business cards.