Pin Me

Turning WordPress Blog Comments Off

written by: •edited by: Michele McDonough•updated: 8/8/2011

Occasionally, bloggers may decide to disable the comments section on their WordPress blogs. Whether you're receiving too many spam comments or you're simply looking to treat your blog as a website, you will find it's not too difficult a task to learn how to turn off comments in WordPress.

  • slide 1 of 4

    Disabling Comments - What, Why, When?

    There are a variety of reasons why you may want to turn off comments on your blog, but the general practice shows this is not very popular. Before you complete this task, you are disabling all possible conversations with and among blog visitors that might otherwise occur. Conversations are a valuable way to encourage readership on your blog, and by inspiring a lively conversation, you increase the likelihood of making money with your blog - should that be your goal.

    There are cases, however, where one might wish to disable comments. For example, outdated posts and paid articles should be temporary disabled to fight spam attacks. Also, many developers who are using the WordPress platform to build other websites (not blogs) may not require a comments section. You can disable comments on a single post, or you can disable comments on the blog as a whole.

    Additionally, you may consider closing comments after you host a blog event such as a giveaway or a limited time poll. By disabling comments in these situations, you can indicate that the poll or contest has been closed. You may also want to turn off comments when there was a heated debate that got out of hand. That way, you can help protect readers and demonstrate that any verbal abuse - even if through the interent - will not be tolerated.

    Just like any other WordPress hack, there are various ways that you will be able to turn comments on or off. You can disable comments by post, page, or website. Just remember to take the purpose of your account and the needs of your readers into consideration.

  • slide 2 of 4

    Disabling Comments From WordPress Settings

    You can disable comments on all posts you create from now on by using the WordPress settings feature. Just navigate to WordPress Settings – Discussions and uncheck “Allow people to post comments on new articles." Remember, though, this only applies to new posts, and will not work retro-actively. You might want to disable commenting on new posts had spam or abuse been a recent problem on your blog.

    To disable comments on older posts, you'll need to follow some additional steps:

    Go to the Posts section, select all, choose edit from the bulk menu, and then choose to disallow comments from the comments combo box on the right.

    Remember that trackbacks and pingbacks are actually comments too. They are created when other blog posts link to yours. If you want to turn off backlinks, trackbacks, and pingbacks, you'll need to make sure that you select this option. Be aware that you may lose traffic by doing this. You'll only want to use this option if spam has gotten completely out of hand.

  • slide 3 of 4

    Disabling Comments Manually

    Some may prefer to edit the actual WordPress files in order to achieve nearly the same results. Something else to consider here is that spam bots don't need the comment form to post spam messages. That's why it is suggested to rename the wp-comments-post.php to something that poses a challenge to others who may be attempting to guess what the comments form address is. In order to manually disable comments, open index.php and remove this line:

    <php comments_popup_link('? No Comments', '? 1 Comment', '? % Comments'); ?>

    Then, open single.php and remove this line:

    <?php comments_template(); ?>

    Finally, open archive.php and remove this line:

    <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?>

    You may wish to test the file to ensure that your code still works before you republish your blog with changes. Sometimes when deleting code, we take too much out. If you don't do too much more, you can almost always hit Control-Z to undo and Control-Y to redo any change.

    You can also edit your index.php file and add the following code:

    <?php if ('open' == $post-> comment_status) {comments_template();}?>

    Basically, your comment template will only appear when comments are enabled. That will make it so that spam bots will have a more difficult time when searching for a place to post random links and comments.

  • slide 4 of 4

    Plugins and Others

    There is a useful plugin in the WordPress Plugin directory that allows you to edit comment appearances on:

    • Posts made before or after a specific date.
    • The last X posts or posts made in the last X days, weeks, months or years.
    • Posts with a certain amount of comments. For example, you can close comments on posts once 10 comments have been left.

    By utilizing such a plugin, you can be sure that you are maximizing the comments feature in WordPress to best benefit both your readers and your blog.

    It may take a while to realize when to keep comments on and when to shut them off on your blog, but knowing how to do it will help you to better make that decision. Make sure you're tracking the visitors to your blog. Does the traffic go up or down when you turn off comments? Know how it affects your blog, and you can determine a good balance between allowing comments and protecting your blog.

    References