How to Disable Comments in WordPress Permanently (Without Plugins or Using Plugins)

Why Do Comments Still Appear Even Though They Are Not Displayed?

Imagine you are building a company profile website for a client. Everything is neat — elegant layout, complete pages, no comments on every post. But one day, you open your dashboard and… strange comments appear from “Cheap Gucci Bag Online” or “Work from Home and Earn $5000 a Week”. Even though you never enabled the comments column.

Huh, how is that possible?

Here's what not many beginner WordPress users know: Comments can be entered directly through the WordPress backend, even if the comments column is not displayed on the frontend. Spambots simply target the file wp-comments-post.php, and they can start attacking.

But don't worry. In this article, you will learn How to turn off comments in WordPress completely and cleanly, either using manual or plugin.

How to Disable WordPress Comments Manually

1. Disable Comments in WordPress Settings

These are the most basic steps:

  • Enter the menu Settings → Discussion
  • Uncheck:
    • “Allow people to submit comments on new posts”
    • “Allow link notifications from other blogs (pingbacks and trackbacks)”
  • Click Save Changes

Note: this only applies to posts that newly created, not an old post.

2. Turn off Comments on Old Posts and Pages (Bulk Edit)

To ensure all old content does not receive comments:

  • Enter the Posts → All Posts
  • Check all → select Edit (bulk) → click Apply
  • In the “Comments” option, select Do not allow
  • Click Update

Repeat this step in the Pages too.

3. Block Access to WordPress Comments Files

If you really want to prevent bot spam:

Open file .htaccess in your WordPress root folder, then add the following code:

<Files wp-comments-post.php>
Order Deny,Allow
Deny from all
</Files>

With this, access to the WordPress comment endpoint will be completely blocked. Spam bots will not be able to “infiltrate” through the back door.

4. Turn off comments via script in theme (Advanced)

If you understand code and want to be “cleaner” without plugins, add this code to the file functions.php of your active theme:

// Disable support for comments and trackbacks in all post types
function disable_comments_post_types_support() {
    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');
        }
    }
}
add_action('admin_init', 'disable_comments_post_types_support');

function disable_comments_status() {
    return false;
}
add_filter('comments_open', 'disable_comments_status', 20, 2);
add_filter('pings_open', 'disable_comments_status', 20, 2);

function disable_comments_hide_existing_comments($comments) {
    return array();
}
add_filter('comments_array', 'disable_comments_hide_existing_comments', 10, 2);

The result? Comments will be disabled completely across the WordPress system.

How to Disable Comments Using a Plugin

Recommended Plugins: Disable Comments

If you want a faster, more practical way that doesn't require you to touch the code:

  1. Install plugin Disable Comments
  2. Enter the menu Settings → Disable Comments
  3. Choose: Everywhere to disable comments on all post types
  4. Click Save Changes

This plugin will:

  • Remove “Comments” menu from dashboard
  • Disable comments endpoint
  • Remove comments feature on posts, pages, media, and more

Highly recommended for company profile, online store, atau landing page websites which does not require discussion features.

Why Do You Need to Turn Off Comments?

  • Avoid spam coming in via bots
  • Speed ​​up page loading (because no comment queries)
  • Improve website professionalism (especially for business)
  • Protecting brand reputation from spam comments that get through the filter

Conclusion: Which is the Best?

MethodPerfect for
Manual via settingsNew user, want a simple way
Edit .htaccessDevelopers who want to prevent bot spam
Add script in themeWeb developer/agency with full access to code
Plugin Disable CommentsAnyone who wants practical and fast

If you don't want to bother, just use the plugin Disable Comments. But if you are building a website for a client and want full control, use a combination of scripts + settings.

Want your website to look professional and be safe from spam?
Mahfudly is ready to help create a modern company profile website, no spam comments, and with extra security system.

➡️ View our Portfolio or Contact Us Now

Contact Us
Tags
Share this content

See other articles

Want to create a website?

Let's talk about your website needs.
Let's connect