Date Exclusion WordPress Plugin

By Daniel Scocco

Would your blog benefit from removing the dates of the posts? That is the question I asked on the post “Should We Remove the Timestamp?”. The feedback from the readers was divided. Some people believe that the timestamp is necessary, while others think that removing the date from posts could have advantages, like increasing the number comments and linkbacks for the older content .

It is probably a subjective matter. Removing the date will work for some blogs, and not for others. Regardless of that choice, a lot of people are not comfortable with editing the WordPress theme files to remove the timestamp. Secondly, the raw editing of such files do not provide flexibility. You can either keep the dates on all the posts or removed them all, there is no in between.

With that problem in mind Stephen decided to code a plugin, called Date Exclusion.

Date Exclusion Plugin

This WordPress plugin gives the user complete control over where and when the timestamp will be displayed. You can exclude them from all posts by default or only on posts older than a few weeks or months. You can also exclude or include dates on a post-by-post level through WordPress’ custom field feature.

Installation

  1. Download and unzip the plugin file
  2. Upload the date-exclusion.php file to your /wp-content/plugins/ directory
  3. Log into your WordPress control panel, click the “Plugins” tab, and click “Activate” next to the Date Exclusion plugin

Configuration

In order to configure the plugin for your needs you will have to open the plugin file (date-exclusion.php). You can do this on the Plugin Editor inside the WordPress control panel.

To exclude date information from all posts by default, set $exclude_date on line 30 equal to ‘yes’. This can be overridden on a post-by-post basis by setting “exclude_date” as a custom field with a value of “no”.

To set a default period of time for every post after which date information should no longer be displayed, set $date_expires on line 33 to the number of days to wait (e.g., 14 for two weeks). This can be overridden on a post-by-post basis by setting “date_expires” as a custom field with a different value (or 0 to deactivate).

To exclude date information from a specific post, set “exclude_date” as a custom field with a value of “yes”.

To make the date of a specific post no longer display after a certain period of time, set “date_expires” as a custom field with a value equal to the number of days you want the date to display.

Version History

Still on the initial release (1.0). Please leave a comment if you encounter any difficulties.

Monetize Your Site




Share

97 Responses to “Date Exclusion WordPress Plugin”

  • Tejvan Net Writing

    looks good i use /%category%/%postname%/ for some blogs, in custom permalink, but it would be good to have option to switch between blogs, although it might look a bit strange to keep switching url style

  • Daniel

    Actually the plugin will not touch URLs, it will just take care of the timestamps within posts.

  • Oz

    Hi

    Sounds like a great plug in

    Unfortunately it was doing nothing for my site.

    Date was still being stamped on each post.

    Any ideas ?

    • Marina

      I would also like to lose the date option on my news items.

      I downloaded and added your plugin and activated it. I then edited it as per your instructions. However due to the permissions settings it wasn’t possible to save the changes in WordPress.

      So I then edited it via the back end of my website using text wrangler. The changes then appeared on the text of the plugin on my website, so I know I managed to do it ok.

      However the date is still showing. I am now wondering whether I did the correct editing? I set the date to expire on the post after 2 days but left the other lines alone.

      I didn’t edit anything in the area where it said don’t edit below this line.

      Any help would be appreciated (and thank you for taking the time to make this plugin)

  • Daniel

    Oz, both Stephen and I tested the plugin, and it was working.

    After activating it, did you open the plugin file to configure it? Because just activating it will not make any change.

    Try opening the plugin file and setting the “$exclude_date” value to “yes”. Check if the dates are gone from the single post pages now (they should).

    Let me know how it goes.

  • Ryan

    Very funny plugin man~
    It works on my site. But I still delete it, because I remove all timestamp on my blog.

  • Oz

    Yeh – I did do that

    Odd I guess – must be conflciting with something else.

    Had to deactivate – I’ll try again when you release a new version

    Cheers

  • trakin

    It does not seem to be working on my blog either. Actually, nothing happens – I st exclude date to “yes” and expire to 15 days and nothing happened. Infact I tried excluding dates from all the posts, but did not seem to work. Neither on single page – nor in category pages…Had to deactivate it…

  • Stephen

    Out of curiosity, what are you using to display date information in your template, Trakin? The plugin works by disabling specific functions. The initial release only disables the_date() and the_time() by default.

    Something else I probably should’ve mentioned is that the plugin will only disable date functions on single post pages. Is there anyone who wants this feature expands to category and/or archive pages? If so, I’ll add it into the next release.

  • Dana

    I like this plugin and it does work for single posts.

    I would LOVE to have it expanded for the index page as well as the category/archive pages 🙂

    Thanks for this contribution!

  • trakin

    I am not too technically proficient, hence I am putting the complete code here.

    if (! is_page()) { // Do not display if we are on a page
    // Date and author
    if (is_single()) { $articledate = get_the_time(‘j. F Y, G:i’) . ‘ Uhr’; } else { $articledate = get_the_time(‘j. F Y’); }

  • Genesis

    It would be very useful to be able to remove all timestamps. I am starting a wedding blog and the information there is timeless, so I would love to be able to remove dates from my archives as well.

  • Daniel

    Genesis, the plugin does that. It just does not touch the homepage posts.

  • Transcriptionist

    Thanks, that’s a great plugin especially to help those articles suiting all times. You could see it in action at my blog except the home page.

  • Transcriptionist

    Thanks, that’s a great plugin especially to help those articles suiting all times. You could see it in action at my blog except the home page. I was in search for such a plugin all over the internet.

  • Top Ten Wordpress Plugins of MT Herald | MT Herald Dot Com

    […]Gives your blog a feeling of freshness by turning off the display of date information after a specified number of days or immediately after posting. Exclusion of date information can be set by default in the plugin file and/or manually for each post. Find the details, installation guide, configuration etc., at Daily Blog Tips[…]

  • Clifford

    hi, thks for plugin. I’ve changed the $exclude date to yes as suggested. however the date and timestamp still shows on my first post as this is a new blogsite. I’m currently using justsimple free template..any help would be appreciated.

    thks

    clifford

  • BrilliantJeni

    I’ve been waiting for a plugin like this since the first day I implemented WordPress on my sites. I think it’s absolutely essential that timestamps are removed from posts- they magically become referred to as “articles” rather than “posts” when the timestamp disappears which not only makes them “timeless” but also more credible, in a sense.

    I’d like the option to take them from the front page as well and on multiple post pages as well, but so far- this works great on most of my sites. Just one that it didn’t work on, but luckily, that’s just a frivolous site I have around for kicks and a little extra revenue. 😉

  • BrilliantJeni

    Ohhh- what about taking the time stamp from comments as well? Comments would obviously run longer if they weren’t dismissed over the time factor.

  • Stacey

    This is so frustrating, Can someone please copy and paste the section I need to change for this to work.

    It says its defaultly set to exclude dates, but it doesn’t seem so because we have to make changes right? Then its not by default is it?

  • jtbloom

    I have tried this plugin on both of my blogs http://www.stylechatter.com and also http://www.subastralinc.com/blog, I went through all the steps listed on activating the plugin as well as changing the value to yes in the date-exclution.php file, nothing happened. The date is still showing on both blogs. Each of my blogs is a different version of wordpress, so I don’t think it is the versions I am using, could there be a conflict with another plugin or possibly issues with the theme I am using. Any ideas on what the problem could be?

  • BrilliantJENI

    Here you go Stacey- I put a snapshot up here: http://www.brilliantjeni.com/2007/09/16/how-to-activate-the-date-exclusion-wordpress-plugin/

    Nothing too detailed, but it shows you exactly where to make the “no” to “yes” change in your Date Exclusion file using the plugin editor.

  • Matt

    works perfectly

  • Bryan

    Hello!

    I installed the plugin and it’s a great idea, but it only takes away the date from the posts and not anywhere else. I don’t mind having dates on the front page, but would prefer no dates anywhere else on the blog. Just removing dates from a post doesn’t really help when folks nav through the cats and see the dates… also the comments have dates too, so, although I like the idea of the plugin, it doesn’t really do a lot that is wanted — it is a great idea, just needs to be expanded… will you expand the plugin so that there are no dates to be found with the exception of the index or frontpage? Thanks tons!

    Bryan

  • David

    Hi,

    I thought this was the exact plugin I needed but I really need one that on a post by post basis gives me the option to remove the date stamp from posts on the home and category pages too.

    Any news on adding this functionality? Happy to donate something to have this as a working feature.

    Cheers

    David

  • kenshiz

    Hey, i can’t get this working on my blog…so sad…
    any tips would be appreciate! ^_^

  • Jacob Share

    I’m playing with the plugin right now, here’s a clarification:

    1) Why are alot of people saying that nothing happened? It may be because of line 36 in date-exclusion.php:

    $deactivated_functions = array(‘the_date’, ‘the_time’);

    However, many themes like mine actually use another function, which I needed to add like this:

    $deactivated_functions = array(‘the_date’, ‘the_time’, ‘get_the_time’);

  • DotDriven

    Thanks for this plugin! I like the idea and could really use something like this for some of my blogs but need something that also pulls the date off the homepage post as well, not just single post.

    I know it has been a while since this was posted but were there ever any updates?

    Thanks again!

  • Glen at Webstart

    Got the plugin working nicely on WordPress MU – did have an issue with a few themes not working with it and they seemed to use only the_date and the_time functions – I’m not sure why they didn’t work but most do.

    Thanks for the great plugin.

  • Stefani

    Seems to be working for me on the blog I set it up on. At first I thought it wasn’t working but after reading the comments, I realized it doesn’t work on the homepage posts but it does on the individual posts when you view them.

  • Steve

    I want to exclude the date from my first sticky post only. Where do I set the custom field as described below? Thanks.

    To exclude date information from a specific post, set “exclude_date” as a custom field with a value of “yes”.

  • kento

    Is it works with WP 2.3.1 ++ ?

  • David

    STEVE SAYS:
    “To exclude date information from a specific post, set “exclude_date” as a custom field with a value of “yes”.”

    Can you give an example of how to set to a custom field?

  • PeterL

    Thanks for the plugin. Works perfectly with WP 2.3.3

    However, it just strips the date, and I am left with some non PHP blurb on each side of it, which doesn’t disappear.

    For example: “Written by PeterL on Dec. 13, 2007 at 4:00 pm”, becomes:

    “Written by PeterL on at ”

    Any ideas how to work around this?
    Peter

  • Jon

    Just tried this on my wordpress 2.5 blog and can’t get it to work either for all posts, or for an individual post.

    Any ideas?

    My theme uses the the_time function.

  • Jon

    Further testing reveals that it works for a single post (single.php), but not for the mail index loop (index.php).

    Any ideas?

  • Jon

    See from previous posts that current plugin does not remove date from index.php.

    So, added code in the index.php to check for the exclude_date custom field and all working fine.

  • Grant

    this plugin wont even show up in the my plugin admin to activate
    any ideas?

  • Healty Guy

    I use WordPress for a number of different sites. For one project I’m using it as a small CMS, and as such I want to turn off the Time and Date functions as they are not that relevant to what I’m doing.

    So I searched and found this page. Unfortunately a year later the Plugin has not been updated to do more than turn single post dates off. This wasn’t enough for what I want to accomplish with this project.

    So I downloaded and installed the plug in (WP 2.5) and enabled it then turned on the feature with “Yes”. And the individual posts did in fact stop displaying dates. However there was a remnant from my template that did display and did not look good. And the dates were not removed from categories so it didn’t work on it’s own for my purpose.

    So I backed up the templates index.php and archive.php files. Then I removed 2 lines of code from each that execute the display of date and time.

    Next I edited the css file to remove the date png graphics.

    And it appears everything is now working fine with no time or date in the way.

    I am still using the plugin to disable display of time and date to the individual posts.

    WordPress has so much more potential if they would include “simple” features like date removal so it could be used much easier for a wider variety of applications.

  • Healthy Guy

    I can’t spell worth a damn.. or type worth a damn.

    I don’t know what a Healty guy is.

    Supposed to say Healthy Guy.

    sorry

  • Erika

    would like to remove dates from PAGES but keep them on POSTS. Esp would like to remove date from home page.

  • Len

    Stephen, your plugin is working well for me (I am excluding all the dates). I do also wish to expand this to the categories. Email me if you can about how I can do this. Thanks a lot!

  • alex alaska p.

    hi,

    thanx gawd for these comments or i would of been pullin’ hair out of my head. soooo okay, post date doesn’t show if shown as an individual post- great.

    i would like to know if a version is going to be made where a sticky post- on the home page can be viewed WITHOUT a datestamp? that would be cool.

    alex alaska p

  • Simon

    HI, I’m in need of this plugin being upgraded to remove dates from category / archive pages. One of my sections is a diary from 1986 which I’m grouping together posts by month – it looks a bit odd with the heading saying Wednesday 1 January 1986 and a sub heading underneth saying 25 October 2008! Can I stress that the plugin does work for me for single post pages.

    Cheers

  • Chris

    I have the latest version of WordPress installed and the plugin doesn’t seem to be working for me.
    It’s already activated.

  • Friedbeef

    Works like a charm – absolutely brilliant!

  • Girl

    It’s just useless if it doesn’t remove timestamps from the homepage as well.

  • Gren Bingham

    Hi, Yes, I’d like to have the option of turning off dates on multi-entry pages too!

  • iveto

    None of the above worked for me… the date remained everywhere.

    So here is what I came up with-I know its retarded but it worked. In the CCS file using trial and error I discovered the tag responsible for styling the date and I made the font-size 0.

    here is a chunk of the code:

    small {
    font-family: ‘Trebuchet MS’;
    font-size: 0.0em;/*used to be 0.9em*/
    line-height: 1.5em;
    }
    Of course this may not work for some themes, but it works perfectly for mine!

  • Kenny

    I tested it out. I don’t want the page t display date but I want the post to display date. I tested it out. It doesn’t work that way. Any solution? It seem when you activate the plugin all post and page will not date display.

  • julia

    Is this plugin able to remove only the date and time posted by articles from the ADMIN?

    I want comments with date.

  • Bang Kritikus

    Please, make more article about blogspot

  • Shannon

    I’m desperately trying to get the date exclusion plugin to work in wordpress version 2.7. However, I’ve come to the conclusion that this plugin is not compatible with that version. Can you confirm if that is correct andl let me know how to exclude the date from my posts? I’m pulling my hair out over here. Thanks!

  • ax0rz

    Yup, I’m unable to get this plugin to work with WordPress 2.7.1. Does anyone know an alternative?

  • Adam W. Warner

    I was able to get this working on my 2.7 install. In the plugin, around line 35, I had to change this:

    // Add the names of any date-related functions you use in your templates
    $deactivated_functions = array(‘the_date’, ‘the_time’);

    to this:

    // Add the names of any date-related functions you use in your templates
    $deactivated_functions = array(‘the_date’, ‘the_time’, ‘get_the_time’);

    See the extra function on the end? I looked in my theme’s files and it was using “get_the_time” instead of just “the_time”.

    Hope that helps:)

  • Pranab

    Ok oK just found out the way to remove the date and time stamp from the homepage too:

    All you have to do is to open the index.php file of your theme and look for the line:

    These are the functions that output the time/date. Just delete or comment them out.

    Done!

  • Pranab

    The line is [ ] (remove the brackets)

  • GregR

    Hey

    I have fixed the problems with the conflicts with WordPress 2.7 and incorporated the suggestions here.

    It is now checked into the WordPress Plugins Repository called Date Exclusion SEO. ( the name has to change because of conflict)

    Thanks

  • Trey

    I installed Date Exclusion SEO today. I want to exclude the date on only one specific post.. is that option still possible?

    I followed the info in the Configuration section above: I went to edit the post, added a custom field called exclude_date, typed yes in the value, updated, and then published the post.

    The page of the post still shows the date below the title. Please help.. thanks!

  • maxguncel

    Just great. Thank you very much.

  • aindreas

    Hi
    great plug in
    I also did what iveto suggested re font size + it worked. So it worked on the whole index of posts + when a post is gone into.
    Thanks 🙂
    a

  • Trey

    Can someone PLEASE help me with my question above??

    I want to exclude the date on one specific post, but it is not working.

    Using the info listed above, I went to my post and added a custom field called exclude_date, typed yes in the value, updated, and then published the post. The date STILL shows below the title of the post.

    PLEASE HELP!!!! Thanks.

  • freerefs

    Just trying to set up my site and cannot for the life of me get this working. I’ve placed the date_exclusion.php in the public_html/wp_content/plugins folder (i think that’s right without looking, but basically where all of the other plugins i have are) and set the permissions to 744 (is that right), then when I go to use the editor in wordpress it gives me no option to save the amendments to the file.

    Any ideas?

  • Spark

    Guys,

    For those that’s didn’t make the whole things work. Note that you need to create a new directory [Which is a new folder] within the plugin folder to make it work.

    Example : public_html/wp_content/plugins folder/removetimestamp -> upload the date_exclusion into the folder [removetimestamp] and follow what it’s mention should do the trick. Hope this help

  • kritios

    >> “To exclude date information from a specific post, set “exclude_date” as a custom field with a value of “yes”.”

    A number of people have asked for an example of how to set to a custom field? I ask for the same, please!

  • Susan

    Well I couldn’t get the plugin to work either, using WordPress 2.8, so I just edited the CSS file of my theme, commented out all styling related to date/time stamp and set that class to display:none; and in my case I also had to adjust the margin of class .posthead so that it lined up with the left margin (instead of leaving a gap on the left where the date used to be). Hope that might help someone. Seems to be working, for the “Bali” theme anyway.

  • Lee MacRae

    This plugin works for me on most blogs I had set up but I recently tried it on WordPress MU 2.8.4a and I get this error on every blog no matter what theme I use on a blog. Any ideas?

    Error! Options page not found.

  • Klaus Tol (guitarhabits.com)

    Hello everyone, I didn’t work for my either.

    You know what does work?

    search for this line:

    in 4 pages: archive.php, index.php, page.php and single.php and replace it for:

    Your dates are now gone in all the posts. Also in the categories.

    Date is gone on all the pages.

  • Klaus Tol (guitarhabits.com)

    For some reason this blog doesn’t show the line I put in the comments to disable the date.

    I saw that Pranab had the same problem.

    If you are interrested in the date exlusion follow me “guitarhabits” on twitter and search for the word “date exclusion” on my page.

    I’ll show you what to do. I’ll put it on right now.

    Klaus Tol

  • Sunroom Desk

    I want to exclude dates only on Calendar posts, which are actually calendar entries and end up with both the calendar date and the posting date. I can’t make this work. How do I “exclude date information from a specific post, set “exclude_date” as a custom field with a value of “yes”.”

    Where do I do this in the plugin php code? I created a custom field called “exclude_date” but that accomplished nothing.

  • Sunroom Desk

    Success! I used “Set to the default number of days after which date information should no longer be displayed; set as 0 to deactivate
    $date_expires = 0;”

    I reset 0 to 3650 – ten years! Nine years from now I’ll have to change it, but now whenever I want to exclude a date from a post, I custom enter a posting date of 1910 (one hundred years ago…just to be safe). IT WORKS!

  • Pat

    Please help. I installed this plugin and couldn’t get it to display properly. So I just deactivated it and deleted it.

    But my site was left with this text displaying where the date was: “Updated at Least WeeklyUpdated at LeastWeekly.” I originally did enter ‘Updated at Least Weekly” as the text to display in place of the date on the front page.

    In addition, at the top of sidebar 1 right above my 1st widget, the text repeats again and looks like so: WeeklyUpdated at Least WeeklyUpdated at Least WeeklyUpdated at Least WeeklyUpdated at Least WeeklyUpdated at Least WeeklyUpdated at Least WeeklyUpdated at Least WeeklyUpdated at Least WeeklyUpdated at Least WeeklyUpdated at Least WeeklyUpdated at Least WeeklyUpdated at Least WeeklyUpdated at Least Weekly.

    It only appears in IE. Firefox looks fine.

    Please tell me what to do to get rid of this. The plugin is gone and that text is still there – in IE. I’m using WordPress 2.9.1.

    Anybody help me.

  • Daniel

    Its been a few months that you said that you would have an update for deleting timestamps from all categories and archives… Any news, any updates yet, its been forever… This would help many, many, many, many, many people alot…

  • Jeff Bode

    is there a way to remove dates from comments?

    …I’ve been searching everywhere for this

  • Laurie

    I really appreciate helpful sites like you but need to point out that a sentence like this

    “Upload the date-exclusion.php file to your /wp-content/plugins/ directory”

    is like giving someone directions to Alaska by saying

    “Turn left when you get to Canada.”

    I have NO idea how to find my wp-content/plugins directory. I don’t have a clear idea how to upload it to that file if I knew where the destination folder was. I can’t be the only one who needs step-by-step instructions that assume no prior knowledge, start at A and proceed to Z without skipping any steps.

    • Eef

      [quote]“Upload the date-exclusion.php file to your /wp-content/plugins/ directory” is like giving someone directions to Alaska by saying
      “Turn left when you get to Canada.” I have NO idea how to find my wp-content/plugins directory…[/quote]

      then you probably have a wordpress.COM account. You have to have a wordpress.ORG account and learn/read (google! for instance) what wordpress is about. When you’ve never have been to Canada, and are planning to go there, you read about it, don’t you?

  • Laurie

    OK, so I figured out that that step happens right in WordPress… so please, help out us novices by saying something like.

    2. In your WordPress dashboard, select Plug-ins, Add New…

    …and so forth.

    Thanks!

  • Laurie

    Daniel, Stephen, Greg, et al –

    Like Steve (comment #30) & Trey (#58, #61) I like having dates on all the posts except the one or two sticky posts at the top of the homepage. Dates are very important on my blog, but having a date on the Welcome sticky really hits the visitor with an impression that the blog hasn’t been updated since Abel was in diapers.

    The instructions on how to edit the code to be able to select which posts don’t display a date just aren’t clear enough.

    Specific instructions, line by line, such as:
    Log into your WordPress dashboard
    Click on
    Then do this
    Then do that
    …as opposed to First go to Canada, then turn left…
    much needed and deeply appreciated.

    Please? and Thanks.

  • Dawn Polk

    Hi! I love your plugin but want to delete date stamp from categories and actually all the dates.
    How do I do this?
    Thank-you in advance,
    Dawn

  • Dawn

    Hi! I love your plugin but want to delete date stamp from categories and actually all the dates.
    How do I do this?
    Thank-you in advance

  • Goji Acai

    hey it worked! :). i was looking everywhere how to get date excluded in WP but couldn’t find anything since i wanted my blog to not look like a blog. didn’t think a plugin was necessary to do the job. :-/ thanks soo much!

  • deborah

    Stephen: I followed your instructions to: Set to ‘yes’ to exclude all date information by default; set to ‘no’ to deactivate
    $exclude_date = ‘yes’;

    I also added a custom field/value.

    I’m not sure what else to do to get this action to be effective in WP 3.0. Any ideas? Thank you in advance for your consideration.

  • Debbie N

    I’ve tried hundreds of combinations and I can’t get the date exclusion seo to work on my site. The dates remain on every page including the blog. I am using dragonskin – gold theme. Any help you can offer would be great. I don’t see line numbers … so i tried counting them to find the $exclude date , that didn’t work so i just started changing everywhere i saw this. Thanks for any help you can offer.

  • Russ

    Love the plugin but I have a question. I have my alt text showing on all my posts and the front page but the dates are still showing up on the other pages. Can you tell me how to set it up so the alt text shows on all posts and pages?

    Thanks!!

  • Paul

    I thought the idea of having plugins was, you don’t have to mess about with code.

    Why can’t all the setting be done on the, er… settings page?

  • Udegbunam Chukwudi

    Any tips on removing the dates from the comment section?

Comments are closed.