I've been on a wordpress hiatus for the past 8 months and have never had to deal with building a website for an actual client. Though, no matter what I tried/how I tried to disable comments, I would always get spammers commenting. What can I do to make sure that comments are really disabled... and what can I do if I want to enable them, but spam gets too much. In essence... what is the industry standard to deal with this?


3 Answers 3


There is no need for a plugin. The reason people get this confused is because posts can have comments enabled or disabled on an individual basis. There is no "global" option, because it's per post.

So really, it just takes two main steps to disable comments in WordPress:

  1. Settings > Discussion. Turn off both "Allow link notifications from other blogs (pingbacks and trackbacks)" and "Allow people to post comments on new articles". This will turn off comments and pings, by default, for all NEW posts. You can still turn them on when you make a new post, if you like, but they will default to off.

  2. Go to every existing post (if any exist already) and turn off the "Allow Comments" and "Allow Pings" options on them.

For this second part, you can do this in bulk in the main Posts screen.

First, simply click the checkbox in the upper left hand corner of the post list, to select all the posts on the screen. Use the Screen Options dropdown in the upper right if you want to see more posts on the screen.

Second, change the "Bulk Actions" dropdown to "Edit" and click the "Apply" button.

Third, in the new bulk editor area that appears, set "Comments" and "Pings" to "Do Not Allow" and click the red "Update" button to set those settings for all the selected posts.

  • Thanks. I have comments disabled on all posts... I think its trackbacks or pingbacks that are hitting my site.
    – EGHDK
    Commented Dec 17, 2014 at 1:47

Upon your question, I think you want to totally disable comment from your website.

There are few ways to do it....

1. You can disable comment in your WordPress settings here...

Settings >> Discussion >> uncheck "Allow people to post comments on new articles"

2. You can use some plugins to do it like


3. You can remove the codes in your template file

The standard file name is single.php nad page.php. But your theme can have some custom templates. Just open your template file with a text editor and find this codes

<?php comments_template( '', true ); ?>

Remove it and the comment section will be totally removed from your website.

  • 1
    item 3 will not disable comments, just the display of the comment form Commented Nov 30, 2014 at 19:22
  • comments_template() actually placed here wp-includes/comment-template.php. It shows the comment form in a website. The question above just gave a perception that he just want to remove the comment system from his website. So removing the comment form can be a solution for this question.
    – Sabbir H
    Commented Dec 4, 2014 at 0:20

Here is code

add_action('admin_init', function () {
    // Redirect any user trying to access comments page
    global $pagenow;
    if ($pagenow === 'edit-comments.php') {

    // Remove comments metabox from dashboard
    remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal');

    // Disable support for comments and trackbacks in post types
    foreach (get_post_types() as $post_type) {
        if (post_type_supports($post_type, 'comments')) {
            remove_post_type_support($post_type, 'comments');
            remove_post_type_support($post_type, 'trackbacks');

// Close comments on the front-end
add_filter('comments_open', '__return_false', 20, 2);
add_filter('pings_open', '__return_false', 20, 2);

// Hide existing comments
add_filter('comments_array', '__return_empty_array', 10, 2);

// Remove comments page in menu
add_action('admin_menu', function () {

// Remove comments links from admin bar
add_action('init', function () {
    if (is_admin_bar_showing()) {
        remove_action('admin_bar_menu', 'wp_admin_bar_comments_menu', 60);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.