Removing “Comments are closed” from WordPress

Repost this article

This is an issue that has irked many a website designer over time. WordPress is a very flexible and powerful system but, let’s face it, the software was designed by and for blogger fans. And what blogger fans and other “social networking tragics” love more than anything in the world is interaction.

And who can blame them!

But many of us have clients who don’t want or need people commenting on every page and post of their site. So the wonderful WordPress commenting feature becomes a pain in the bottom instead.

Sure, you can “turn off” commenting but you’re still stuck with a pointless confusing statement at the end of every page and post on your clients site saying “Comments are closed” or something similar.

Getting rid of that statement is possible but, unfortunately, a confusing process because each theme or template used by WordPress has the bit that’s responsible placed in different files.

So, you might read somewhere that you just go to “singlepost.php” and delete a line but discover your theme doesn’t have any such file.

Hopefully, this post will help you sort out what in the heck is going on for at least some templates (themes) you and your clients are using.

Here (in no particular order) are some different methods for removing the “comments are closed” text from a WordPress site.  Check your theme for relevant files and then the stated lines within the files. If you can’t find the files and or lines for one solution, try one of the others. Somewhere in here you will hopefully find the right answer for your situation.

Note that these suggestions all assume you’ve already turned off commenting in your site by going into Settings > Discussion in your Admin panel and unchecking the “Allow people to post comments on the article” box.

1. Using the “singlepost.php” and/or “page.php” and/or “”singlepage.php” files

If your theme has one or more of these files included, look for the line

< ? php comments_template(); ? >

Once you’ve found it you have 2 options for stopping it from working.

a) Delete it (not recommended but lots of people do it)

b) Do what’s called “comment it out”. This means you use a bit of simple code to hide it so it won’t work. But if you have any problems it’s easy to remove the “commented out” symbols and restore it back to it’s original state. I just find it a safer method than blithely deleting stuff from the code base.

“Commenting out” looks like this

/*Bit you want to hide*/

Everything between the /* and */ will be ignored as if it’s not there.

2. Using the “comments.php”

In some themes (eg the lovely Amazing Grace) the solution is in the file called “comments.php”. Find the bit that looks something like this:

php else : // comments are closed ?
!– If comments are closed. –>
p class=”nocomments”>Comments are closed</p>

And remove the text that is displaying on your site (the words at the very end in bold). If you’re not sure which bit is the text try putting in a tilda  ~ and see if it shows up on the site. If so, you know you have your culprit and can delete the text for display there. Make sure you leave everything else exactly as it is.

If this option is available to you in your theme praise the designer because it means, if you want to, you can still have comments activated on some of your posts. It doesn’t remove anything except one line of ordinary text that usually displays on your site.

3. Using comments.php part 2 (Leptonhead’s solution)

If you can’t find the above line in your comments.php try leptonhead’s suggestion:

1) Go inside the theme folder through FTP and open comments.php

2) Look in comments.php for something that looks like this:

[div class="messagebox"]
[?php _e('Comments are closed.', 'inove'); ?]
[/div]

NB “inove” is the name of the theme, so if you are using another theme look for the name of your theme instead. I know that this bit can also be found in the Options theme and Structure theme but not in the Default or Classic theme.

3) Delete/comment out that entire block.

Thanks leptonhead!!

3. Delete the comments.php entirely

I haven’t ever tried this but I have seen it suggested. It seems a bit drastic to me. I will let you know if it works when I get a chance to experiment with it.

Anyone got other suggestions?

4. CSS

And another suggestion from Shu and Jasonfor those who are comfortable using CSS (thanks both of you!)

A “safer” and simpler solution is to hide the text using css:

.nocomments { display:none; }

Please read comments for more information on above solutions – your question might already be answered!

This entry was posted in Wordpress tips. Bookmark the permalink.

144 Responses to Removing “Comments are closed” from WordPress

  1. leptonhead says:

    Hi, been trying to figure this out, too. This seems to work.
    1) Go to Settings > Discussion in the Admin panel.
    2) Remove “Allow people to post comments on the article” by unchecking the box.
    3) Go inside the theme folder through FTP and open comments.php
    4)
    Look in comments.php for:

    5) Delete that. (Commenting things out never seems to work for me).
    Voila!

    Thanks for your help.

  2. leptonhead says:

    Hmm, the code I found doesn’t show up, maybe a security device in the comment box. I’ll mess it up so you can see which part. I put brackets instead of the usual symbol. Hope that works.

    [div class="messagebox"]
    [?php _e('Comments are closed.', 'inove'); ?]
    [/div]

  3. admin says:

    Hi leptonhead!

    Thank you so much for your contribution.

    Actually, I’m shocked you found my site, it’s really not set up properly yet and I’m just posting things as I work on them for clients. LOL But I’m glad you did.

    I havent tested your suggestion yet but I had a quick look in the themes files for that code. As is so often the case, that code doesn’t occur in all themes (eg it’s not in the default theme comments.php) but I did find it in the theme I’m using for this site which is based on the ‘Structure’ theme by Justin Tadlock.

    The word ‘inove’ is obviously the name of the theme you are using as in my theme it was replaced with the word ‘structure’. I also found the line of code in Justins ‘Options’ theme where the word at the end was, of course ‘options’.

    Anyway, I’ll test your suggestion asap and it looks like I better stop using this site as a playground for my experiments and start taking it more seriously if people are starting to visit!!! LOL

  4. leptonhead says:

    Hello Admin,

    No problem! I noticed there were no comments and your post along with several other google results, helped me piece together a solution.

    That’s funny that you weren’t prepared for visitors; amazing how google’s spiders find you. The place looks nice!

    And yes, ‘inove’ is the theme name, and I suspect simply searching for “Comments are closed” will usually reveal that message box in most add-on themes, but I am not sure.

    Great work!

  5. leptonhead says:

    Hey admin,

    My mom’s name is Sheila and once at dinner, maybe 20 years ago, a really rude Australian girlfriend of a friend of my mom’s said that “sheila” meant “hooker/prostitute” in Australia. Is that true, and if so, was the name of this site intentional?

    I’m being sincere and curious, not inflammatory.

  6. admin says:

    No it doesn’t, the Australian girlfriend was not only rude but either ignorant or deliberately trying to upset your mum.

    “Sheila” just means “woman” but was traditionally used in a “putdown” sexist sort of way – like “bird” or “chick” or “bit of skirt”. The term “sheila” is usually used in reference to blokes girlfriends or wives (“Hey, Johnno, where’s ya sheila?”) or a nice looking ‘woman’ (“that sheila is hot”) or about a female who is admired (“she’s a top sheila”) . It can also be used in that putdown sense of “you play like a sheila” but then so can “girl” or “woman”.

    I chose it because I like Aussie slang and I also like to take misunderstood semi-derogatory words like sheila and use them in a positive sense. It’s also more fun than “woman” and I wanted to convey the flavour of this business being female and aussie.

    Where I live, in the country, it’s used all the time by both men and women and isn’t seen as derogatory anymore. It’s mostly city people, who are out of touch with genuine Aussie behaviour, who still think it’s a derogatory word (some even think it’s not used anymore!!) but no genuine Australian would believe it means “prostitute”.

    Aussie terms for something as naughty as prostitution are FAR more colourful and rude than the fairly friendly term “Sheila” ;) LOL

    Your mum has a lovely name.

  7. Rose Vines says:

    Expect more visitors! You helped me out of a pickle, thanks.

    (from a sister web sheila, currently living in the USA).

  8. admin says:

    Ahhhh! That’s fantastic! I love helping people out and sharing knowledge n stuff. Even more so when it’s with a kindred spirit! Thanks for the comment :)

  9. mike2030 says:

    My blog show permanantly show- comments are close.

    Open status is update in database.

    Please guide us

  10. admin says:

    Hi Mike,

    Thanks for dropping by! I’d be happy to help ya.

    Can you give me more information! Where does the “comments are closed” show up? (in the articles or in the categories?

    Did you try any of the solutions above? What, if anything happened?

    What theme or framework are you using? And what version of WordPress?

    Cheers

  11. Shadestealer says:

    Thanks, your site saved me quite some time. I have done this before but it was at least a year or two ago and I didn’t remember how I got it to work it at all. I used leptonhead’s method suggested in his comment and it worked like a charm, you should probably include it in the main article.
    Oh and by the way – Google doesn’t seem to think that your site isn’t set up properly. Expect more visits soon since this is one of the biggest issues every WordPress user encounters and you seem to have the best solutions here.
    Cheers

  12. admin says:

    Good point shadestealer – I’ve added leptonhead’s suggestion to the article. Glad this site helped you!!

  13. Joe says:

    Worked very well.
    Thanks for the post.

  14. Andy Ghozali says:

    Awesome post am going to link to mine from here by blogging about it

  15. Pingback: Removing 'Comments are closed' Wordpress | Andy Ghozali

  16. admin says:

    Thanks Andy – and kudos for the proper credit to me on your blog :) Glad to be of help to so many people!!

  17. vickie says:

    Thank you! Your suggestion worked perfectly. My question is how do you activate the comments for some posts once you have removed the code from the “comments.php” file? I understand I’m simply removing text, but not sure how/where to add it back for the posts where I want to allow comments. I have static pages (don’t want comments on those) and one page (my blog page) that I do want to allow comments. Any help/direction is appreciated.

  18. admin says:

    Hi vickie! Just letting you know I’ve got your question. Give me a day or two to get back to you. Cheers!

  19. Sue Parker says:

    Worked like a charm! Thanks for posting your tip.

  20. Andie Nantz says:

    Oh my goodness. I’ve never made a website before, but thanks to you, I’ll have just a few more hairs left on my head after all this.

    Blessings!

  21. Ed says:

    Awesome! Really helped out.
    Thank you very much.

    Ed

  22. Shopwarematt says:

    Great this worked awesome for my iNove theme!

  23. Symphony says:

    HI there. thanks for this very useful post! I have used the “commenting out” method successfully on a number of sites now. however – these have been sites where I don’t want comments to occur at all… EVER!

    So… having got my creative juices flowing, and given an existing site a makeover – I’m a little nervous about removing something I shouldn’t.

    Basically I allow (and welcome) comments on posts… but not on pages. I have a single.php file (for posts) and a page.php (for page template) but no singlepage.php file, and I’m concerned that this is an “all or nothing”.

    These “comments are closed” only started appearing for me in the last update of Artisteer (damn them… but I do love the program!).

    I don’t suppose you have any advice you could help me with could you?

    Thanks ever so much in advance… and thanks again for being in the right place so often!

    Symphony
    PS: Nice to meet other “Web Sheila”s :D

  24. admin says:

    Hi Symphony!! Glad my site has been some help to you. Yes this is an all or nothing thing and Vickie asked about a similar question earlier. Sorry I haven’t answered it yet but I’ve had a family tragedy in the meantime and haven’t been doing much on the net. I will look into it asap. I suspect some people will need to use a special template. (I take it your an aussie too!!)

  25. Symphony says:

    Thanks for trying to help… and I’m so very sorry to hear of your family news.
    No I’m not an aussie… just a female.
    Symphony xx

  26. Just wanted to say thank you for posting an in-depth description on how to remove “comments are closed”. I searched many different ways and to my surprise, found someone that knew exactly what I was trying to do.
    Great work, fantastic theme , fantastic post.

    Regards,
    Think Local Marketing

  27. Beverly says:

    Thank you so much – this saved me so much time! I just started using WordPress as a CMS for clients and this was an icky stumbling block.

  28. arnold says:

    Actually to comment out on a php or html page you would use the following:

    the example you used:

    /*bit you want to hid*/

    is for commenting in CSS

    • admin says:

      Thanks for that Arnold and lostoracle. Whatever works eh!

    • admin says:

      Just for clarification:

      So how do you add comments into your PHP code? There are in fact several was to add a comment. The first is by using // to comment out a line. Here is an example:

      < ?php
      echo "hello";
      //this is a comment
      echo " there";
      ?>

      If you have a single line comment, another option is to use a # sign. Here is an example of this:

      < ?php
      echo "hello";
      #this is a comment
      echo " there";
      ?>

      If you have a longer, multi line comment, the best way to comment is by using /* */. You can contain several lines of commenting inside a block. Here is an example:

      < ?php
      echo "hello";
      /*
      Using this method
      you can create a larger block of text
      and it will all be commented out
      */
      echo " there";
      ?>

  29. Lena says:

    Thanks! This helped me with my work for a swedish client.
    I am building a WordPress webshop and got stuck on the “comments are closed” so i googled and found your information. Great help!

  30. kpol says:

    Thanks to share, methode I use is : in the path of used theme, look for comments.php and inside

    .. now just remove the phrase… ;-)

  31. kpol says:

    humm code dont appears … :-/

  32. LostOracle says:

    You could also use CSS to hide the class in question. In the style.css add the following style:

    .nocomments {display:none;}

    If you don’t know what class style is being applied then I would highly recommend the Firefox addon, Firebug.

  33. raymond says:

    wow!!! its great working perfectly on my web

  34. carla says:

    Thank you so much for putting this info on the web. I hate see the “no comments” on my pages. It was so easy. I used step 2 above. I had someone tell me a very complicated way and I don’t write code so it really wasn’t helpful.

  35. Sebastian says:

    There is a great video showing how to edit the comment.php to remove the ‘comments are closed’ text and comment box at:

    http://www.positivebusinessonline.com/remove-comments-are-closed

    Very easy to follow and I change mine easily after watching this.

  36. Pete says:

    `2. Using the “comments.php” ` worked like a charm! Thanks for the advice (saved me a lot of hair-pulling!). Much appreciated!

    Cheers!

  37. Thanks admin….. finally managed to get rid of. I used Leptonhead’s solution. But I edited using file manager in Cpanel.

    Now time to find out how to get rid of ‘DATE’

    cheers,
    Liza

  38. Liss says:

    I used Leptonhead’s solution and it works ………
    thanx !

  39. Jason says:

    Another thing you can do instead of permanently deleting the PHP code is this.

    Find the specific CSS code for your comments. In the example listed above, it is a class of ‘nocomments’. Then add the following code:

    .nocomments {display:none;}

    Display:none removes that element from the rendered view. It will still show in the source code.

    • admin says:

      Hi Jason

      Thanks for that – I’ll give it a test run and if it’s as easy to do as it sounds I’ll add it to the article :)

  40. Is there any plug in that can do the job?

  41. Kate says:

    Thanks for the help. If anyone else is using the F2 theme, the code is in page.php

  42. Thanks a lot for the article. You save my time. Been searching for the method high and low ….. finally found here. I used Leptonhead’s solution.

  43. Tara says:

    Thank you so much!! This worked great. And thanks to Symphony, too. I didn’t know that single.php was for posts. Commenting out the offending code didn’t help my pages and now I know why. Awesome.

  44. elkin says:

    very helpful thanks!

  45. Daniel says:

    If you are removing the “Comments are Closed” you might also want to remove the “Comments (0).” You can do this by commenting out or removing the code:

    [?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?]

    (Replace the brackets with triangle brackets).

  46. Monte says:

    Thanks! livesaver!

  47. Jason says:

    Cool! It worked great. I just did this

    <!–comment closed –>

  48. PK says:

    Thanks a lot! Your suggestion was very useful.

  49. I just followed your instructions – and thankfully it was easy enough to find – thanks for posting – really nice to be rid of the comment about comments being closed :) )
    Thanks to @DoMyBooks on twitter for pointing me here – much appreciated to all

  50. Eve says:

    This was so hugely helpful! Thank you Sheila!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

What is 15 + 11 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)