How to remove “Comments Closed” to appear on your home and pages on WordPress blog / Removing “Comments Closed” message to appear in wordpress

Thursday, 24th March 2011

I’m currently configuring one wordpress based installation to serve as a mini website for old fashined furniture.

By so far I was able to close the comments on the wordpress Pages but still face huge difficulties with making the wordpress installation to looes it’s blog a like, look and feel and look a bit like a normal website.

The major issue I faced was with removing the irritating message Comments Closed which was appearing right after my post on my Home configured wordpress page.

It took me some readings online and some experimentation until I got the solution, to make the life easier of other people who face the Comments Closed can’t remove issue here is how I scraped the message out:

1. Go to your wordpress install directory and look for the wp-content/themes directory inside it select the theme which you have selected as a default for your wordpress via the admin page.
I assume you’re using the default template and thus switch to the directory wp-content/themes/default , e.g.:

wp-host:~# cd /var/www/wordpress/wp-content/themes/default 2. Inside the theme directory look up all your files for records like:

Comments Closed

wp-host:/var/www/wordpress/wp-content/themes/default:~# grep -rli 'Comments Closed' *
archive.php
de_DE.mo
es_ES.mo
fr_FR.mo
index.php
it_IT.mo
page.php
ru_RU.mo
search.php
single.php

As you can see in the output there are few php files which seems to include the Comments Closed text inside them, therefore our files of interest which needs modifications are: archive.php, index.php, page.php, search.php and single.php

3. Open up each of the aforementioned php files and look in each one of them for:

comments_popup_link([ some code ]);

When you stumble on the comments_popup_link function one line before the function opening php code with <php starts insert the code:

<?php if('open' == $post-<comment_status) : ?>

At the end of the <?php comments_popup_link([ some code ]);?> code on the next line fill in the code:

<?php endif;?>

4. Do the step 3 for all your found php files which include the comments_popup_link function.That’s it now your “Comments Closed” message will disappear all your wordpress posts and the wordpress install would start looking more like a website.

Share this on:

Download PDFDownload PDF

Tags:

5 Responses to “How to remove “Comments Closed” to appear on your home and pages on WordPress blog / Removing “Comments Closed” message to appear in wordpress”

  1. Samuel says:
    Firefox 5.0 Firefox 5.0 Windows 7 x64 Edition Windows 7 x64 Edition
    Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0

    I can not understand why remove this comment. Does it harm wp site or what?

    View CommentView Comment
  2. Mike says:
    Firefox 3.6.10 Firefox 3.6.10 Windows 7 Windows 7
    Mozilla/5.0 (Windows; U; Windows NT 6.1; fr; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10 GTB7.1

    Merci

    View CommentView Comment
  3. Percy Deutschendorf says:
    Firefox 3.5.3 Firefox 3.5.3 Windows 7 Windows 7
    Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3

    Great post !!! I have found very helpful tips here.Thanks for sharing it…

    View CommentView Comment

Leave a Reply

CommentLuv badge