How to Remove The Post Dates from Your WordPress Blog

If you’ve ever wanted to create an “evergreen” WordPress blog by removing post dates, here’s how to do it.

Transcript:

Hi, this is Laura Roeder and today I’m going to show you how to remove the post dates from your WordPress blog so that your blog posts can stay more evergreen, so that someone doesn’t look at your blog and see that it’s a year old. If you remove the dates they don’t know when you wrote it and it helps blogs seem more timeless.

So, this is going to get much more technical than the information that I usually share. The only way to remove the date is to go into the code and to read a little bit of code. So we are going to be code monkeys today, more technical than I usually get but I’m designing this for people who do not know PHP. So, if you don’t know PHP, if you don’t know HTML, don’t worry, I think you can follow along and do this, I’m going to show you exactly what to look for. So, let’s get started.

The first thing you want to do is sign into your WordPress website. I’ve just created a test site for the purpose of this presentation and you can see that right now there is the date. There is the headline and then right below it is March 29th, 2009. So we want to take that date off, that’s our goal, it’s what we’re doing right now. So, how you’re going to do this is to go to the editor under appearance. So on the left hand side you’ll see appearance and then you’ll see editor and we’re going to need to look for the piece of code that references this date in all of our WordPress template files and we’re going to remove it. So basically this date is created by a piece of code that tells WordPress to recall the date that the post was created so if we take out that piece of code this date will longer show up.

So, I’m going to start with the main and next template because I know it’s there but as you’ll see in a minute I’m going to ask you to go through all the templates because the date can show up in a lot of places. It’s going to show up on archives, it’s going to show up on the regular post page. Without being familiar with the code you don’t really know where it’s going to show up so the safest bet is to search for everything. So again under appearance I went to editor and you can just start with any of these pages. I’m starting with the main index template for the purpose of this presentation because I know it’s in there and then I want you to do a find. You can do this using your browser, just Ctrl F or or apple F will find something in the content. What we’re going to look for is the phrase, the_time. You can see it right here, the_time. That’s a little code snippet that tells you that WordPress is looking for the date.

Once I’ve found the time, it’s highlighted right here and this is the entire bit of code. I’m going to isolate it so that it’s a little easier to read. Just so you know, in code you can move – space stuff out as much as you want. If I put all these spaces before and after it does not affect the code so don’t worry about putting spaces before and after something in order to make it easier to see. So, remember we did a search for the time. Here’s the time right here and then there is other kind of gobbledygook that surrounds the time. This is the PHP WordPress code so what we want to do is isolate just the time. The way you can do that is to look for these little brackets right here, this little less than, greater than signs. That shows you the beginning and end of a piece of code.

So, when you look for the time it’s going to look a different depending on how they have it set up. It might not have this ‘fjsy’ exactly as this one is because there is a few different ways you can do it which is why I’m having you look for the time, that’s universal and to find the whole piece of code you’re going to look for these little carrots outlining it. This one in the beginning and this one in the end that’s how you know you have one solid piece of code because you don’t want to break in the middle of the code or else this won’t work. Basically you can think of it as you need to take out this entire piece not just part of it. So once you’ve found that, one thing you can do is just delete but I’m going to show you a better way.

So, instead of deleting it we’re going to do what’s called commenting it out. So comments are a way to add a line of code that you want for your own reference but that won’t affect what actually happens on a web site. People use comments for notes to other developers and stuff like that but it’s also a way to have your web site not read a piece of code without having to delete entirely. So it’s a good idea to use comments to kill a piece of code so that you’re not deleting it so you can still get it back if you need it. So again the first step is to search for the time, then you want to isolate it by looking for these little characters on the beginning and on the end and then we want to make it a comment. The code to do that is you put this little greater than sign, an exclamation point and then two dashes and then you close it by putting two dashes, and then another little carrot there.

So again the way I told you this marks the beginning and end, this marks the beginning and end of a comment as well. So, it starts with the – I think I said greater than sign but this is actually a less than sign isn’t it. Oh I have to remember my elementary school math. Let’s just say the arrow that’s pointing to the left. It starts with that, then you have an exclamation point and then two dashes, then inside of that you’re putting your little the time code snippet, and then you end it with another two dashes and a little arrow pointing to the right. So this is what the whole thing should look like and then you want to go ahead and update your file to save it.

So, I want to do another find for the time to make sure I got all the instances. Okay, there’s only one, and then I just want to click on all these template files on the right hand side and do that search. Okay, so it’s not in the comments file in this instance but you need to search every file in your theme because it’s different, every theme. Okay, it’s not in footer. Let’s look in the header. It’s not in the header. We already looked in the main index template, let’s look in the search forum, okay it’s not there. Let’s look in the side bar. Not there and let’s look in theme functions. Not there. Okay, so in this one we only had to look in one template. Again this totally depends on your theme. You might find it in more than one template but in our case it was only in the main index template.

I just want to give you another really brief refresher of what I did. I searched for the time. I isolated that little code snippet and then I commented it out using this code right here, I made it disappear.  We’re going to check and see if what we did worked. So remember this is the old version. I’m going to refresh this page and see if March 29th, 2009 disappears and it does. All right, that means that it worked and we should be able to click on the individual posts and it should be gone from there as well. So that is how you remove the date from a post in WordPress. Again, the key thing that you want to do, you want to go under appearance, go to the editor, just do a find through each one of these files. You want to look for the_time. You want to isolate that little snippet of code and then you want to comment it out.

You want to make it a comment instead of an actually piece of code by doing this little carrot exclamation point two dashes, another two dashes and then the little carrot going the other way. You can also just go ahead and delete this code but it’s better to do this so that if you ever want to bring it back you still have it there. You hit update file and that’s all you have to do. Then you have your great web site without any kind of date on the post.

Again this is Laura Roeder. You can check out my web site at lkrsocialmedia.com.

Need more actionable advice?
Get your FREE weekly marketing “to-do” list
straight to your inbox every Wednesday:
About Laura Roeder

Laura Roeder is a social media marketing expert who gives businesses of all sizes the tools they need to make their mark on the web. She is the creator of the social media scheduling software Edgar, as well as social media marketing web courses like Creating Fame and Social Brilliant.

Comments

  1. Michael Johnston says:

    Removing the dates is fine if your content is evergreen; but if your content isn’t, this tactic is a bit deceptive.

  2. Stoney McGee says:

    Great! One less thing I have to figure out on my own. Thanks, Laura!

  3. I find it’s easier to do with CSS. But that’s just me. This is a great tactic for any blogger to consider. It’s not for everyone of course, but I prefer no dates on my own blog as well. I can’t imagine it being perceived as *deceptive* though :-)

  4. I’m glad to know this trick, Laura. It may make good sense for my blog since my topics are, for the most part, not at all date sensitive.

    For anyone writing about technical issues or products, however, I hope they would not delete their dates. When doing research for an article, I’ve been frustrated many times when there was not date on a post or article so I could determine if the content was timely or not.

  5. Great tutorial, thanks. I noticed that a lot of ‘A-listers’ are doing this, and started doing it myself but sometimes when you’re reading a blog, you want to know when a post was published. The best way to find out is to look in the comments. Those are usually dated.

  6. Laura, how would this affect search engines? I understood that search engines search for the latest content by date. PHP coding is fun :-). Thanks for sharing the nugget.

  7. Thanks so much! I was wanting to find out how to do this!
    Jackie

  8. Hi Laura!

    Thanks for the tip – my content is really evergreen as well so I like the idea of removing dates but I have the same question as Casar – wouldn’t this affect your SEO?

    Thanks again!
    Vicki

  9. It won’t change the SEO results at all. The date is just a text output in the post for the reader’s benefit. The actual publication date in the RSS feed will stay the same, and Google is smart enough to know when it’s published based upon when it first shows up on the Internet.

  10. The best thing to do is to create a “Living URL” – Michael Gray gives a good tutorial here:
    http://www.wolf-howl.com/seo/wordpress-living-urls/

  11. Strong SEO relies on link velocity (how fast your page gets backlinks and how high-quality those backlinks are). Publishing or not publishing the date itself won’t matter, but as the post gets older, its link velocity slows down, so it will fall in the ranks as other posts with a higher link velocity overtake it.

    I moved the dates in my posts to the bottom of the post several months ago and didn’t notice any change in my SE rankings.

    -Erica

  12. I’m currently using the free DateExclusion plugin but it doesn’t remove the dates from comments or archives. Does your method remove dates from comments and archives too?

    • Steve – yes. If you search through every template file as I show in the video and comment out every instance you’ll remove all the dates from the archives. As far as the comment dates, you’ll need to find the piece of codes that inserts the comment date comment that out.

  13. Thank you Laura! Your post here saved me some major grief.

    In case you or someone didn’t already mention this…

    I did everything you said but my site was still showing the date for the comments. So I searched the comments.php page, I found that (for my theme – Kubrick) the code to search for is this…

    Thanks again! ;-)

    Stephen

  14. I see now that it wouldn’t let me show the php code when I submitted my previous reply, but the thing to look for on the comments.php page for the Kubrick Theme is…

    comment_date

    …and there you will see that the rest of the code is the same as what you originally showed: (‘F jS, Y’) etc.

  15. On the most recent version of wordpress, I can’t seem to find editor under appearance. Is there a different way to access this on the newer version of wordpress?

  16. Tried: http://oozman.com/oozing/ideas/archives/oozman-date-remover-wordpress-plugin

    It works great for me. Maybe you can try it out.

  17. And it works on most of the themes. I’ve tried it also on Thesis Theme, works excellent. :)