How to permanently disable WordPress comment?

Last updated on December 15, 2009. Tags: ,

For some, comments have been an integral part of blogs and without comments, they believe that a blog is not a real blog. However, there are bloggers who would prefer to not receive any comment.

There are several possible reasons why a blog owner or administrator would want to disable the comment. Some of them are:

For whatever reasons you would like to disable the comments in your blog, clicking the disable comment checkbox whenever you have a new post or page can be very tiring. To disable comment permanently in your WordPress posts, look for this line of code in the Single Post file (single.php) of your theme:

<?php comments_template(); ?>

... and delete it. Deleting this code will permanently remove the comments in your post as well as the form wherein visitors can type comments. The comments and comment form do not appear regardless of whether you check the disable comment checkbox or not.

To disable comments in pages. Delete the same code from the Page template (page.php) of your theme. The effect is also the same; the comments posted and the comment form both disappear.

So far, almost all the WordPress themes (including the "WordPress Default") that I encountered have single.php and page.php files, and these files have <?php comments_template(); ?> that enables the comment. The "WordPress Classic" theme does not have this files but it has the same comment enabling code in its Main Index Template (index.php), which you can remove to produce the same results.

Posted by Greten on June 3, 2009 under WordPress tweaks

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • StumbleUpon
  • Technorati

Related Posts

You might also be interested (randomly generated):

Post Comments

Please double check your comment before clicking the "Post" button. Once you clicked it, there will be no way for you to edit your comment.





* Required. Your email will never be displayed in public.