Extended Comment Options for WordPress

Current version: 2.5

One feature which is conspicuously absent from WordPress is the ability to switch comments on or off for all posts. Under the Options > Discussion page, you can switch the default setting for comments on or off, but that only applies to posts you make from that point forward.

You can disable comments on individual posts, but if you’ve got more than twenty posts, this takes ages! This plugin allows you to quickly and easily switch comments (and trackbacks/pingbacks) on or off with a single click.

Extended Comment Options 2.5 has been tested on WordPress versions 2.7. Support for versions below this cannot be guaranteed. Upgrading to the latest version of WordPress is always recommended.

FAQ: Hidden Comments

Does your plugin hide comments already on my posts?

No. If you find comments being hidden after they have been closed, it is likely that your theme (i.e. the design of your blog) is hiding comments as a result of comments being opened/closed on posts. You can contact the author of the theme to see if they’ll correct this problem.

Instructions

The plugin adds a page under “Comments” called “Batch Status”. All the settings are available from this page.

Select whether you want to open or close comments — and whether
you want this to apply to comments, pings, or both.

In the “Which posts?” section, you can choose which groups of posts you want to affect.

You can choose

  1. All posts
  2. Posts made before or after a certain date.
  3. All but the last X posts, or days, weeks, months or years.
  4. Posts with more than X comments.

These options can also be applied automatically — so you can set it once and forget about it.

Excluding posts

You can select posts that this plugin shouldn’t touch.

Results

If everything has gone well, the plugin will display a brief summary of what you asked it to do. You can use this to check that it’s done what you wanted it to do.

Installation

Extended Comment Options is installed like any other WordPress plugin. Download the .zip file from the WordPress plugins page, and extract it. Place the file named “commentcontrol.php” in your wp-content/plugins directory, and activate it in the usual way from the “Plugins” page in your admin area.

wordpress.org/extend/plugins/extended-comment-options/

Upgrading

Upgrading is really easy. Just overwrite the commentcontrol.php file with the new version. You may need to re-activate the plugin from your admin area.

Recent versions of WordPress allow you to upgrade automatically from within your admin area.

Support and Future versions

Feature requests are always more than welcome.

I’m happy to provide support for this plugin. You can leave a comment on this page or email me at beingmrkenny@gmail.com.

Version History

Current Version: 2.5

Tuesday 21st April, 2009

  • Simpler admin: removed advanced/simple separation, made excluding posts easier.
  • Fixed bugs with auto mode.
  • Updated for 2.7.

Version 2.0

Monday 10th January, 2008

  • Added a new option: “When number of comments reaches a certain number”
  • Major new feature: automatically close comments. So you can set comments to close on posts older than 30 days, and it’ll update automatically each day.
  • Polished a few of the messages, made them easier to understand. Also reworded the admin interface to make it easier to understand.
  • Behind the scenes: security is tighter. Also dates are calculated differently: One month ago from the 10th Jan is the 10th Dec. One year ago from 10th Jan 2008 is 10th Jan 2007, instead of being counted as everything beyond the current year.

Version 1.2

Friday 21st September, 2007

  • The page now shows up under the “Comments” menu in WordPress, as opposed to the “Options” menu.
  • The plugin now reports which posts were not affected (if selected) a lot more efficiently.
  • The “Simple settings” options were previously changing the excluded posts setting. This is now no longer the case.
  • Now supports more recent versions of WordPress (v 2.2) — specifically, it only affects published posts, no longer pages.

Version 1.1

Tuesday 25th July, 2006

  • Tightened security
  • “Last X posts” — fixed bug arising when X was greater than total number of posts!
  • Compatible with WordPress v1.5.2.

Version 1.0

Saturday 22nd July, 2006

  • Extended Comment Options first released!

36 Comments

  1. Armin  •  Jul 24, 2006 @5:10 pm

    Sweet, just testing it atm, looks promissing

  2. CT  •  Jul 25, 2006 @3:35 pm

    Compatibility? Is this for WP 2.x only, or will it work on 1.5.x?

  3. Mark  •  Jul 25, 2006 @4:28 pm

    Hi CT,

    Just released an update which I tested on WP v 1.5.2, and it’s compatible. Thanks for asking!

  4. CT  •  Jul 25, 2006 @5:03 pm

    Excellent. I do think I’ll give it a spin.

  5. TechZ  •  Jul 25, 2006 @5:52 pm

    Brilliant! That’s why I love WP, you think of something you need for your blog, and some smart person writes a plugin for it :P

    Thanks :D

  6. Blippy  •  Sep 13, 2006 @3:52 pm

    I’m looking for a plugin that will allow me to specify an X number of comments (ie. 10)before closing (and excluding pin/trackbacks). I was told this plugin was capable of this but I cant see it as an option. Ideas?

  7. Mark  •  Sep 14, 2006 @11:11 am

    @Blippy:

    Did you mean you wanted to do that automatically, each time a new post is made? If so I’m afraid my plugin can’t do that for you at the moment :(

    But you can do it yourself, in the Advanced Settings section:

    1. Set the status to: open
    2. Apply this to: make sure only the Comments checkbox is checked.
    3. You may uncheck the default status box if you wish
    4. Set “The last” to 10 and make sure “Posts” is displayed in the drop-down menu.

    Then click Update!

  8. Hans  •  Oct 17, 2006 @10:25 pm

    I’m looking for a plugin that will either just supply a link which when clicked upon shows all comments made, preferably being able to set a max number per page with navigation for next page/previous page.

    It would be cool if this could be done from the dashboard too.

    Is this possible with this plugin?

  9. Mark  •  Oct 17, 2006 @11:13 pm

    Hi Hans,

    No my plugin doesn’t do that, but the Paged Comments plugin does!

  10. Hans  •  Oct 18, 2006 @9:19 am

    Thanks Mark :)

  11. Pi.  •  Dec 2, 2006 @10:13 pm

    I note that the program has to be reactivated at regular intervals as the ‘close everything older than 25 days’ (for example) doesn’t automatically update each day. Perhaps in the next update?

    Also, can you perhaps consider an option whereby pings and trackbacks remain but comments are closed and vice versa?

    More than happy with the plug-in otherwise, as it means by Akismet has considerably less to do, since the bulk of comment spam is aimed at older posts.

    Pi.

  12. Jesse Colburn  •  Jun 28, 2007 @12:09 pm

    is there a way to tweak the plugin to add the option “set comments status to closed when the number of comments gets to ______?”

    i know it sounds weird, i think someone else requested something similar, but it seems like it would be useful, and i need it in the project i am working on, so when someone comments it would automatically close comments on that post – that way i can use the “if comments closed” php tag

    i am crazy i know

  13. vijay  •  Nov 1, 2007 @5:22 am

    Nice plugin what I was looking for.. Will test soon
    Thanx

  14. Jenn  •  Dec 28, 2007 @9:41 pm

    Would there be a way to modify this plugin so that it can force comments for a specific post to be moderated? There are some instances where I think it would be helpful to have a post’s comments moderated on a post-by-post basis.

  15. Mark  •  Dec 29, 2007 @1:13 am

    Hi Jenn,

    Good idea, that’s something for me to think about for the next version. When I get some time I’ll look at that, and a couple of other solutions people have posted here. Thanks!

  16. Karl  •  Jan 8, 2008 @11:59 am

    Is it (or could it be made) possible to have old posts set so that it’s not possible for someoen to add a new comment, but that old comments are still readable? It seems to me that this plugin, when it closes posts to comments, it hides comments that are already there. I find that 99% of spam comes in as comments to old posts but I’d like to be able to block it without losing comments that people have already made.

  17. Mark  •  Jan 8, 2008 @5:07 pm

    Hi Karl,

    I deliberately made Extended Comment Options so that it doesn’t hide existing comments. It’s probably your theme that is doing that.

    If you know PHP you can look in the file called single.php in your theme folder, there’ll probably be a conditional which inserts the comment form and comments if comments are open. Normally, it’s only the comment form that’s inside the conditional.

    If not, get in touch with whoever designed the theme or someone who can help with PHP. The support forums are a great place to start.

  18. chris  •  Jan 11, 2008 @1:04 am

    Hey,

    I got a website im working on at the moment, while i have comments i’d like to turn off for certain posts i’d also like to remove certain aspects from those particular posts also, like the date ect..

    Is it possible to use the code you use to turn off the comments but also adapt it so it wraps around other variables in the page like;

    IF commentsystem = off DO NOT DIsplay Date ELSE Display Date

  19. Mark  •  Jan 11, 2008 @8:07 am

    I haven’t been into a theme file in a while, so I can’t remember if this is exactly right, but I think whether comments are open or not is stored in a variable called $comments. All you’d need to do would be to check if this has a value of true or not:

    < ?php
    if (true == $comments) {
    post_date(); // Or whatever it is, I forget...
    }
    ?>

  20. chris  •  Jan 11, 2008 @2:26 pm

    Thankyou Mark, ill give this a try tonight. I appreciate the help.

  21. Samuel  •  Jan 13, 2008 @6:52 pm

    There is not any mention about 2.0 in the history here and neither in WP extend (or I cant see it). And jumping to 1.2 to 2.0 is a high jump… :)

    Please, could you tell us what is changed in the 2.0?.

    Thanks!

  22. Mark  •  Jan 14, 2008 @11:47 am

    Samuel:

    Hehe, sure. I’m gonna update the page soon, when I get some time, but the biggest change is the automatic feature (you can set comments to close automatically now). Also, you can close comments once there’s a certain number of them, which a couple of people have asked for.

    There are some other small changes, better security and a different way of working out dates, but they’re largely behind the scenes.

  23. Ross  •  Feb 21, 2008 @12:59 pm

    Great plugin, thanks for your efforts on this, however ….

    when I try to set the automatic schedule to close comments older than 3 months it says it has done it with the messages, but on returning it does the opposite!

    So, if I select Open (radio button) all comments older than 3 months from now on it sets them to closed as required. Bascially there is a bug reading the Open/Close radio button round the wrong way.

    I hope this helps.

  24. Mark  •  Feb 21, 2008 @11:27 pm

    Thanks Ross, I’ll look into this as soon as I can!

  25. Chris Masse  •  Mar 10, 2008 @10:00 am

    Thanks for the plugin.
    Would be great if it managed pages too (as opposed to just posts).
    Thanks again.
    Chris Masse

  26. Mark  •  Mar 10, 2008 @10:08 am

    Hi Chris,

    That will be the next feature to be added!

    Mark

  27. kamera  •  Mar 19, 2008 @8:45 pm

    Nice plugin what I was looking for.. Will test soon
    Thanx

  28. Manolo  •  Apr 2, 2008 @8:03 pm

    wow!

  29. kamera sistemleri  •  Apr 10, 2008 @12:42 pm

    Nice plugin what I was looking for.. Will test soon
    Thanx

  30. Tari  •  Apr 14, 2008 @5:21 am

    Is it compatible to WP 2.5? If not, do you plan to update it in the future?

  31. Mark  •  May 2, 2008 @10:00 am

    Hi Tari (and everyone)

    Looks like there’s a few problems with the latest upgrade. Gonna take a look at it this weekend, though.

    Cheers!

  32. Pete  •  May 3, 2008 @4:29 am

    Is it possible for the settings in the comment status page’s Advanced Settings section to be maintained so you can easily see what you had once selected? Currently mine always revert back to the default settings. Thank you.

  33. Mark  •  May 8, 2008 @11:37 am

    Just to keep people posted… I’m working on a new version of the plugin, which should be available in the next few weeks as I get time to work on it!

  34. Suzanne  •  May 17, 2008 @1:12 pm

    Thanks for this very handy plug-in Mark. I’m just curious if one of the bugs that appeared with the new version of WP was the inability to undo previous actions. Not sure how to put that clearly, but at one point I turned off comments older that (I think) January 1, 2008 and now, no matter what I try, they won’t turn back on.

    I figured it was due to the WP update, but I thought I’d check.

    Cheers!

  35. Ron Fredericks  •  May 24, 2008 @5:12 am

    Nice plugin. I wish I could use your tool to close only a few selected posts and pages to comments.

    Thanks for making this code available,

    Ron

  36. Mark  •  May 25, 2008 @12:16 am

    Thanks Ron. I take comments like this on board, these are good ideas that I’d like to incorporate into future versions.

12 Trackbacks