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. Anne Shaw says:

    It is really helpful for me; I have a problem of inadequate comments on my pages and many of them gave same comment regularly. Going to try it, thank you for suggestions.

    • admin says:

      Hi Anne. You might need to set up some spam protection by the sounds of things. A lot of spammers have an automatic spam system that will post repeat comments. Cheers and glad to have helped

  2. Chey says:

    Thank you. Thank you. THANK YOU! I’m an Art Director and have no experience with coding. Your explanation was perfect! :)

    • admin says:

      LOL YOu’re welcome!! SOrry I didn’t approve this earlier – it accidentally got sent to spam along with a few others.

  3. Casinova Cor says:

    The last thing a blogowner is waiting for is a whole tornado of comments that have nothing to do with the subject and are equivalent to spam. So yeah I totally understand your issue. Adjusting things like that should be made more easily and not a whole hassle to get those things arranged. Let’s hope they work it out sooner or later!

  4. Mike says:

    The “One Click” plugin is interesting but doesn’t solve the problem.

    I have been comparing answers on various sites and have had basically no luck. I was optimistic about the css suggestion but couldn’t figure that out (and I note that there are no replies on this site to people asking how that works!).

    MY discovery, and I am AMAZED by how COOL this is – is that the theme I’m using “Atahualpa” (very popular as I understand), has the ability to change this or turn it off EASILY.

    Under the theme settings you will see a section called “Commenting.” The solution was to remove the offending code by simply removing the text from the “Comments are closed text” field in the settings. VERY NICE! (says Borat).

    Is that cool or what? By the way, Atahualpa takes some tweaking but is completely adaptable to your own vision / design. Try it out.

    • admin says:

      Hi mike

      Thanks for commenting. Sorry you couldn’t get anything to work. What couldn’t you figure out about the CSS suggestion? Mind you, I’m no great expert on CSS either but I might be able to come up with something if I knew a bit more about what problem you’re having with it. I have use Atahualpa and remember liking it at first but then deciding it wasn’t for me – too many options and whatnot and it felt like I had little understanding of what was going on with my site design. I can’t explain it better than that. Nothing wrong with the theme – just not for me. I prefer to try and use a very simple template and work stuff out for myself so that I have control over what’s going on with my site and also learn as much as I can along the way. But for anyone who just wants to get a plug and play site up and running it might be useful. Thanks again for your comment – nice site you got there!

  5. Thank you, thank you,thank you!!! Just what I was looking for!
    “Commented them out” and they’re gone! Awesome! :-)

  6. David Leigh says:

    Also check your plugins, I’ve just spend a few hours trying to find where “Comments Closed” was being generated. It turned out to be the Facebook Comments for WordPress plugin.

  7. fresh_fx59 says:

    The other way is to access the database and change comment_status and ping_status field in wp_posts to open for preferred posts.

  8. Toni says:

    But does this work with pages? This is where I’m having the issue, not the posts, but the pages.

  9. Toni says:

    Never mind. I wound up removing in my page.php file. It doesn’t mess with the posts, only the pages.

  10. admin says:

    Apologies to some commentors from the past month or so – you’re comments got lost in the spam filter so I didn’t notice them till today. Have now published them all (except the spam ones – obviously LOL) Cheers!

  11. Under the theme settings you will see a section called “Commenting.” The solution was to remove the offending code by simply removing the text from the “Comments are closed text” field in the settings. VERY NICE! (says Borat).

  12. Awesome Advice! Thanks so much for the post. It just so happens I was using the Inove theme anyway and this answered my question exactly! I did however have problems hiding the code with the /**/ function so I ended up using comment tags instead to hide the comment message box. Thanks again!

    -Andrew

  13. Misty Light says:

    Thank You. I tried everything everyone suggested to get ‘comments are closed’ off my pages and finally got it to work with the CSS suggestion. Great!

  14. Adam says:

    I’ve just this minute dashed out a plug in that uses the css solution (I dislike anything that involves editing themes since they tend to get overwritten on changes and updates and you have to remember every bit of bespoking you have done) and it seems to work a treat. If anyone were interested I could upload it to the wordpress plugin repository later

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 + 12 ?
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) :-)