If your content is not time-oriented (such as when using WordPress in non-blog contexts), you may wish to remove the publication date from your posts since this information is not relevant and can give the impression that your older content is outdated.
1. The Manual Method
The “proper” way to do this would be to edit your theme and remove the code that displays the post dates.
- Backup your theme, just in case
- Go to “Appearance > Editor” and repeat the following steps for each of your theme’s PHP files
- Look for these function calls in your theme’s code:
the_date(),echo get_the_date(),the_modified_date(), andthe_time() - Surround the function calls with PHP comment markers (
/*and*/); here are some examples:<?php /*the_date();*/ ?> <?php /*the_date('F j, Y');*/ ?> <?php /*echo get_the_date();*/ ?> <?php /*the_modified_date();*/ ?> <?php /*the_modified_date('', 'Last modified ');*/ ?> <?php /*the_time( get_option('date_format') );*/ ?> - You may want to remove other text surrounding the function call. For example, if your theme has this code…
<div>Published on <?php the_time( get_option('date_format') ); ?></div>…and you replace it with this…
<div>Published on <?php /*the_time( get_option('date_format') );*/ ?></div>…your theme will output “Published on,” but not the date. Deleting “Published on” from your theme file will remove it from your site. Just be aware that you may have to remove text like this from your theme files to get a clean-looking result.
- Click “Update File”
2. The Automatic Method
If you’re looking for a quick fix, just go to “Appearance > Editor” in your WordPress admin and add this code to your theme’s functions.php file. Put it at the top of the file, but after the opening <?php line.
function jl_remove_post_dates() {
add_filter('the_date', '__return_false');
add_filter('the_time', '__return_false');
add_filter('the_modified_date', '__return_false');
} add_action('loop_start', 'jl_remove_post_dates');
(Note: This method requires WordPress 3.0 or above)
Now check your site and verify that the post dates are gone. If they’re not, try replacing the code above with this more “aggressive” version:
function jl_remove_post_dates() {
add_filter('the_date', '__return_false');
add_filter('the_time', '__return_false');
add_filter('the_modified_date', '__return_false');
add_filter('get_the_date', '__return_false');
add_filter('get_the_time', '__return_false');
add_filter('get_the_modified_date', '__return_false');
} add_action('loop_start', 'jl_remove_post_dates');

Thank you for this short guide… I tried the automatic method and it works without a problem.
I tried the automatic fix, but it did not work (it resulted in some strange text appearing at the top margin of the website). I have restored the text back to normal, but perhaps I am pasting the text in the wrong place. When I tried it the first time I pasted it at the very top of the text file before any other text. Should I be pasting it somewhere else in the text box? The functions.php box starts with the following text:
<?php
/**
* TwentyTen functions and definitions
*
* Sets up the theme and provides some helper functions. Some helper functions
* are used in the theme as custom template tags. Others are attached to action and
* filter hooks in WordPress to change core functionality.
Thanks
@JRum: Go to the end of the
<?phpline, press Enter to create a new line, and paste in the code. Let me know if that works.My “appearance” menu doesn’t have an “edit” option. It has themes, widgets, menus, background, header, custom design, iPad, extras, and nothing else. How do I find this mysterious theme editor? (I’m using this theme 2010)
It sounds like your blog is running on a WordPress multisite setup. If you’re using WordPress.com or another multisite network that’s owned by someone else, editing themes won’t be an option. If you’re running your own multisite setup, you’ll have to go to Network Admin to find the theme editor.
What’s “multisite setup?”
I don’t have “editor” in “Appearances.” I’ve tried changing the code and fooling around with no real experience in what I’m doing, but nothing saves. Obviously, MY version is idiot-proofed. : )
This Word Press stuff is a mystery. I don’t understand the different types – the difference between the free version and the templates for purchase. And they don’t really want to tell us…
If they could be clear about what I’m getting, I’d make the choice to upgrade/purchase/buy hosting/whatever/add on all the stuff that costs more money in order to get what I want. But they don’t say what you’re getting until you bought it and it doesn’t meet your expectations.
I’m super cautious now. By the time I’m done throwing down the credit card, I could have had a ‘real’ website for what I spent.
Is it possible to remove date information only from meta description of the page and still show it on the page?
Yes. The date information shows up in the meta description because your theme marks up your posts as hEntry objects. There should be a <div> with the “hentry” class surrounding each post, and another <div> with the “hfeed” class surrounding the post list. I haven’t tested it myself, but as far as I know, removing those classes should remove the date info from your meta descriptions.
I tried it and got this error…
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘__return_false’ was given in /home3/healthcl/public_html/fmg/blog/wp-includes/plugin.php on line 166
What version of WordPress are you using? As stated in the post, the automatic method requires WordPress 3.0 or above.
Great suggestion and works well for me. I have no programming experience and experimented by adding a couple of extra lines of code in there. this allowed me to remove the author and title as well as the date and time.
function jl_remove_post_dates() {
add_filter(‘the_date’, ‘__return_false’);
add_filter(‘the_author’, ‘__return_false’);
add_filter(‘the_title’, ‘__return_false’);
add_filter(‘the_time’, ‘__return_false’);
add_filter(‘the_modified_date’, ‘__return_false’);
add_filter(‘get_the_date’, ‘__return_false’);
add_filter(‘get_the_author’, ‘__return_false’);
add_filter(‘get_the_title’, ‘__return_false’);
add_filter(‘get_the_time’, ‘__return_false’);
add_filter(‘get_the_modified_date’, ‘__return_false’);
} add_action(‘loop_start’, ‘jl_remove_post_dates’);
When publishing content that is time-oriented I use static pages. Nevertheless, information on alternative approaches is always appreciated. I’ll file it away for future use. Thanks.
Hi John, nice site you have. And thanks for helping us out with these handy articles.
I tried to turn of the date for my wp site. I got it fixed with the more “aggressive” version. The one above didn’t work. But I have a (maybe stupid) question: is it possible to turn of the Published | By admin notice on my site?
please have a look: bloemistinamsterdam (dot) nl didn’t put a link, don’t want it to be indexed yet.
Hope you can help!
thanks,
Stefan
hey, @stefan your question is not stupid at all.because i also need this fix and i think everyone will need it because you don’t want to show “published on” since you don’t want the date at all.
PS:thanks for this function but if can also remove the published on with function then it would be great!
Hi John,
great post. It helped me a lot.
A little warning to you readers, if you want to modify the default theme it is better to copy it and use this copied version.
Otherwise, WordPress will overwrite your modified default theme during an update.
Thanks
Hi John,
I used your automatic method (the aggressive version) to delete dates from my word press blog. Unfortunately I accidentally forgot to copy the last few characters ); of the code and now the entire website/admin-area is not working anymore. Do you have any idea how to fix it? I cannot open the website at all…
Looking forward to hearing from you soon!
Conny
Use an FTP program to rename your theme’s functions.php file.
Hey John
Thanks for great post …
I want to remove dates from certain category ..How can i do that ?
I just found following line in loop-single.php “sprintf(esc_attr__( ‘View all posts by %s’, ‘unspoken’ ), get_the_author() ), get_the_author()), get_the_date(),”
Lemme know what code i need to add. Would be great help to me
Baba
I used the more aggressive method and it still says “posted on” but the date has been removed. Anyway to remove the post “posted on”
Mvcrews and others: Locate the code I’ve pasted below in your functions page – it should be just above the get the date, get the time, etc. Just delete where it says “posted on”
function twentyeleven_posted_on() {
printf( __( ‘ Posted on %4$s by %7$s‘, ‘twentyeleven’ ),
Thank you for this nice tutorial.
I’m a beginner and I don’t have much aknoledge about coding, but it is clear and easy to follow tutorial.
By the way, I’d like to remove the date from one post only, not from all posts as the tuto points. So, how could we remove a given post’s date?
Thank you
Thank you….I tried the automatic method and it works without a problem.
Hi John,
I am looking to remove the search box from under the header so I can have the menu continue across the page not make a second line. (using twenty eleven)
Regards
Gary
I am using Atahualpa but I can’t seem to figure how to remove the date and time. Can you help?
May I ask you a question?
Have you ever tried to use do_shortcode function in admin page or menu page?
I found it is not work when using it in that situation.
Could u do me a favor?
Worked For me also thanks
I used your aggressive code running on WordPress 3.3.1 with the Thesis theme and it worked great!!!
Thanks,
Oleg
The Automatic Method Works without a problem. Thanks a lot…
I personally redefined the function that displays the ‘posted on’ of my parent theme in my child theme’s functions.php to an empty function. In my case, the function was twentyeleven_posted_on() for my theme that is a child of twentyeleven. I find it more clean, since i don’t modify official themes, and who knows if those dates functions are not used for something else
John: thanks for the simple guide. I thought it was going to be much harder or that I would have to find a different theme, but thanks again your a life saver! ( :
Best wishes,
William Veasley
You are a legend!
Thanks man! The maunuel method worked great. Keep up the good work and God bless!
Thanks! The auto method works!
Thanks it works well for me too
Hi I tried the automatic method & also tried to put in extra categories following the pattern and like John (above tried) to get rid of the “posted on”. However I am now getting:
Parse error: syntax error, unexpected T_STRING in /home/content/13/9242813/html/Christmas/wp-content/themes/admired/functions.php on line 10
I repasted the original information back into the function php but it won’t accept it and now I can’t access any of the dashboard, theme or editing pages, all clicks lead back to the error page.
I’d be grateful for any help you could give me in restoring my blog (or at least my access to it)!
Kat
Is there a way to do this if we don’t upgrade? I am using a free version.
The more aggressive version worked perfect for the Genesis Theme. Thanks so much!
Thank you very much, i remove my date so easy. Thank you thank you
Very nice. The first method did not work for me but the second more aggressive method did work. Pasted at the top of the functions file as you explained. I am using the Genesis Framework with the Outreach theme and most current version of Word Press. Not even sure which one but I keep it updated. Thanks again very much for your help! Worked like a charm and only took a second to copy and paste.
Thanks for this tips! I remove on one our project date
Thank u so much for the automatic method. I tried everything ppl posted and nothing worked. I already wanted to give up but then I found your post. THANK YOU!!!!
the aggressive works. now just have to figure out how to remove who it was posted by and the category that it was posted under.
Hi John, I had to remove the post date on wordpress but on a different theme, I found the .php file that the post was using and searched for date within the file, then used your method of /* */ within the line of code () it worked first time! I found fix to be excellent and in the code it is very clean and easy to apply, thank you very much
Yes pretty much right. It will remove the date from all post. thanks.
The automated method worked instantly. Awesome tips. Thank you.
Tried your auto method. Now I only get a funky on the top of my wordpress blog. No content shows any longer. Am I ever scared that I messed up my whole website. I can log into my site in wordpress, but this is what I see:
function jl_remove_post_dates() { add_filter(‘the_date’, ‘__return_false’); add_filter(‘the_time’, ‘__return_false’); add_filter(‘the_modified_date’, ‘__return_false’); } add_action(‘loop_start’, ‘jl_remove_post_dates’);
What happened to my content?
Clarification – My website shows, but I cannot get into my WordPress to alter the website.
HELP!! Please HELP!!
Thanks.
Jo
You need to put the code after the opening
<?phpline. I’m sorry that the instructions weren’t clear on that. I’ve updated the post to clarify that the<?phpline needs to come first.If you can’t get into WordPress to edit the file, you’ll need to use an FTP program (such as FileZilla) to download it to your computer, where you can edit it, and then use the FTP program to re-upload it.
You need to put the code after the opening
<?phpline. I’m sorry that the post wasn’t more clear on this. I’ve updated the post to clarify that the<?phpline needs to come first.If you can’t get into WordPress to edit the file, you should be able to edit it using an FTP program or by going into your web host’s control panel.
Thank you, John, for this useful post. I’ve been wanting to do this for awhile. You’ve made it simple.
Terrific site you have here. I’m looking forward to reviewing more of your fine work!
TJ
Hey John,
nice site you have. And thanks for helping us out with these handy articles. I’m very greatfull to you.
This worked wonderfully. Thanks.
Hi John!
Wow..been looking forever for info. Have succeeded in removing dates/time from other blog, and used a plug in on this one. BUT…CANNOT get the time/date removed from the comments.
They show up as links and thinking that maybe they are in archives, even though I don’t use the archive feature on the blog.
I looked through code…eliminated all I could find that might be pertinent on functions, single etc. But NOTHING works. I am NOT adept at code..but did it to remove on posts before. But this Comment ‘link’ date’time
is a real bugger.
I tried BOTH of your codes at the top of functions. NO go. Tried adding other wording, like archives, comments..etc in the code. No Go.
Do you have any advice or code I can paste in to get these dang time/date stamps off the comments?
Thanks so much…awaiting breathlessly with crossed fingers! :-0
Cee
thank you very much