How to permanently disable WordPress comment?

Last updated on November 28, 2011. 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:

  • The blog was intended to be a pure informational website wherein audience interaction is considered unnecessary.
  • The blog owner would like to prevent opposing opinions from appearing in his or her blog (although comment moderation is usually enough for this because the blog owner usually would want to display similar opinions)
  • The blog owner does not like the idea of having his or her blog being used for backlink building, either by spammers or sometime even by site owners who want to have legitimate discussion

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

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

Related Posts

You might also be interested (randomly generated):

Post Comments





Comment Rules and Reminders

  • The links to the commentator's e-mail do not have nofollow tag. However, I will be very strict in approving comments.
  • When you comment, please say something that indicates that you indeed read my post. If your comment is a general statement that can fit to any blog post about any topic, it will be regarded as spam.
  • What you write in the name field may include keywords to your website provided that (1) it's only up to four words long and (2) at least one of these four words is your first name or nickname. I rather reply to Bob or to Joe Smith than to Online Marketing Tips.
  • 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.
  • Fields marked with asterisks (*) are required. Your email will never be displayed in public.