How I Disable Comments in WordPress (Without a Plugin)

If you’re not using comments on your WordPress site, there’s no reason to keep that system loaded. Instead of installing a plugin, I prefer to disable comments entirely with a few lines of code. This removes the comment feature from both the frontend and admin, keeping everything cleaner, more lightweight, and eliminating an extra area that could be targeted for spam or abuse.

Once added, comments are completely gone — no comment boxes, no dashboard section, and no leftover comment functionality running in the background.

PHP
/**
 * Disable Comments Everywhere (Frontend + Admin)
 */
add_action('init', function () {
    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_filter('comments_open', '__return_false', 20, 2);
add_filter('pings_open', '__return_false', 20, 2);

add_filter('comments_array', '__return_empty_array', 10, 2);

add_action('admin_menu', function () {
    remove_menu_page('edit-comments.php');
});

add_action('admin_init', function () {
    global $pagenow;
    if ($pagenow === 'edit-comments.php') {
        wp_redirect(admin_url());
        exit;
    }
});

add_action('wp_before_admin_bar_render', function () {
    global $wp_admin_bar;
    $wp_admin_bar->remove_menu('comments');
});

add_filter('manage_posts_columns', function ($columns) {
    unset($columns['comments']);
    return $columns;
});

Continue Exploring

Explore All Guides

Tools We Recommend

Recommended Tools

Shopify

Shopify is one of the most powerful all-in-one eCommerce platforms available today, designed to help anyone—from beginners to…

4.7
Updraft

UpdraftPlus Review – The Easiest Way to Back Up Your WordPress Website If you’re running a WordPress site…

4.7
Free / Pro from $70/yr (2 sites)
Zillion Designs

At manzari.com, we’ve been using Zillion Designs since 2015 as our go-to platform for logo design and brand…

4.5
From $199 (+ 20% processing fee)

Affiliate links — we may earn a commission at no extra cost to you.

About Manzari

Manzari is an independent publisher focused on WordPress, website technology, business software, and practical tech guides. Our goal is to help you choose better tools and make informed decisions with honest, transparent recommendations.

57+
In-depth WordPress guides
23+
Real tools tested & reviewed
21yr
Building with WordPress
100%
No paid placements, ever