Header Text - Disable Comments on WordPress

WordPress allows visitors to leave comments on posts, which can be a great way to encourage discussion and engagement. However, there are times when you might want to disable comments. This could be due to spam, off-topic discussions, or if comments are irrelevant. Managing comments effectively is important to keep your website user-friendly and clutter-free.

This tutorial shows you how to disable comments on WordPress sites, whether you want to turn them off on specific posts or across your entire site. This will help maintain a clean and organized site that focuses on content and provides a better experience for your visitors.

KEY TAKEAWAYS

  1. Disabling comments in WordPress can help you manage user interaction effectively by reducing spam or irrelevant discussions.
  2. You can disable comments on WordPress for new posts, existing content, or site-wide using plugins or manual code changes.
  3. Specific comment settings can be customized for different post types, allowing flexibility based on your content needs.
  4. Plugins like “Disable Comments – Remove Comments & Stop Spam [Multi-Site Support]” turn off comments across your entire website, including for posts, pages, or custom post types.
  5. Adding custom code to your child theme’s functions.php file can also disable comments on WordPress across all content types, ensuring they are removed globally.
  6. You may manage comments via moderation rather than disabling them completely.

Disable Comments on WordPress for Future Posts

In WordPress, comments are enabled by default, which means visitors can leave comments on new posts. However, if you no longer want to allow comments on future posts, WordPress makes it easy to disable this feature. To turn off comments for future posts, follow these steps:

Log in to your WordPress site and head to the admin dashboard. On the left-side menu, click Settings, then choose Discussion from the dropdown menu.

How To Disable Comments On WordPress - Discussion Settings in WordPress

Here, you’ll find an option that says Allow people to submit comments on new posts under the Default post settings section. Uncheck this box to disable comments for future posts.

How To Disable Comments On WordPress - Disable Comments for Future Posts

Now, scroll to the bottom of the page and click Save Changes to save your selections.

How To Disable Comments On WordPress - Save Changes in WordPress

Doing so will prevent comments from being enabled on any new posts you create, but it won’t affect existing posts. It’s a simple way to manage comments on future content without manually disabling them each time you publish a post.

Disable Comments on WordPress: Existing Posts & Pages

When you have already published posts or pages with comments enabled but now wish to have no comments on those posts or pages, there is a simple way to manage this in WordPress. You can either disable comments on individual posts or apply the changes to multiple posts simultaneously. Let’s look at these 2 approaches below:

For Individual Posts

To disable comments on an individual WordPress post, go to the WordPress dashboard and navigate to Posts All Posts (or Pages All Pages).

How To Disable Comments On WordPress - All Posts in WordPress

Hover your mouse over the post you want to edit. You’ll see several options under the title. Click on Quick Edit under the post title.

How To Disable Comments On WordPress - Quick Edit Settings for a Post

In Quick Edit, there is an option labeled Allow Comments. Uncheck this box to disable comments on WordPress for that specific post. Lastly, click Update to save the changes.

How To Disable Comments On WordPress - Disable Comments After Publishing a Post

For Multiple Posts

If you want to disable comments on WordPress on several posts or pages simultaneously, go to Posts All Posts (or Pages All Pages if you’re doing it for pages). Check the boxes next to the posts you want to edit. From the dropdown at the top of the post list, select Edit and click Apply.

How To Disable Comments On WordPress - Edit Multiple Posts

A bulk editing screen will appear. Find the Comments section and select Do not allow from the dropdown. Finally, click Update to apply the changes to all selected posts.

How To Disable Comments On WordPress - Disable Comments in Multiple Posts

These methods allow you to quickly turn off comments on individual posts or across multiple posts, ensuring that no further comments can be added to your existing content. You may use the same process for WordPress pages.

Use Plugin to Disable Comments on WordPress Site

If you want to disable comments on WordPress across your entire site without manually editing individual posts or pages, a plugin like Disable Comments can make the process quick and easy. This method is useful to remove comments entirely from all posts, pages, and custom post types.

This plugin is one of the most popular tools to disable comments on WordPress sites. It allows you to disable comments on WordPress completely with just a few clicks. You can also disable comments only on posts, pages, or even across the entire site. It’s a simple and efficient solution for site-wide comment management.

Here are the steps to install and configure the plugin:

Go to WordPress DashboardPlugins Add New Plugin. Type “disable comments” in the search box. Once your desired plugin appears, click Install Now.

How To Disable Comments On WordPress - Install Plugin

Next, click Activate to start using the plugin.

How To Disable Comments On WordPress - Activate Plugin

After that, go to Settings Disable Comments. You’ll see options to disable comments on Everywhere (the entire site) or for specific types such as Posts, Pages, or Media. Choose the option that fits your needs. If you want to disable comments across the entire site, select Everywhere.

How To Disable Comments On WordPress - Disable Comments on Entire WordPress Site

Important: You may also switch to the DELETE COMMENTS tab to delete comments, whether they are from the whole website or a specific post type.

Once you’ve configured the settings, click Save Changes to apply the changes.

How To Disable Comments On WordPress - Save Your Preferences

With this WordPress plugin, you don’t have to worry about manually disabling comments on individual posts or pages. It’s a great solution for managing comments quickly and efficiently across your site.

Experience tailored solutions with Hosted.com’s WordPress Hosting.
Let us take care of all the technical aspects of WordPress with our expert support team.

WordPress Turn off Comments Manually via Code

The previous methods we explored are better for beginners. Those comfortable working with code can disable comments on WordPress sites by adding a few lines of code to the functions.php file in their WordPress theme.

This approach gives you full control and avoids the need for a plugin. However, it’s important to use a child theme when making these changes to prevent them from being lost during parent theme updates.

Here’s how you can do it:

Access your WordPress website’s files using an FTP client (FileZilla) or File Manager in your hosting control panel (like cPanel). Hosted.com users can access their site’s files by navigating to cPanel Tools Files File Manager.

How To Disable Comments On WordPress - Hosted’s File Manager

Then, navigate to /public_html/wp-content/themes/astra-child/ directory. In our case, /public_html/ is the root directory of the WordPress installation. Also, astra-child is the name of the child theme. Ensure you replace them with yours. Once you’re in your child theme’s folder, select the functions.php file and click Edit.

How To Disable Comments On WordPress - Edit functions.php File

Now that you’re in the functions.php file, you can add the following code snippet to disable comments on WordPress sites:

// Disable support for comments and trackbacks in all post types

function disable_comments_post_types_support() {

    // Get all registered post types in WordPress

    $post_types = get_post_types();

    // Loop through each post type to check if it supports comments or trackbacks

    foreach ($post_types as $post_type) {

        // If the post type supports comments, remove support for both comments and trackbacks

        if(post_type_supports($post_type, 'comments')) {

            // Disable comments for the current post type

            remove_post_type_support($post_type, 'comments');

            // Disable trackbacks for the current post type

            remove_post_type_support($post_type, 'trackbacks');

        }

    }

}

// Hook into 'admin_init' to execute the function during WordPress admin initialization

add_action('admin_init', 'disable_comments_post_types_support');

// Close comments on the front-end for all post types

function disable_comments_status() {

    // Always return false, indicating comments are closed

    return false;

}

// Filter to close comments on all posts

add_filter('comments_open', 'disable_comments_status', 20, 2);

// Filter to close pings/trackbacks on all posts

add_filter('pings_open', 'disable_comments_status', 20, 2);

// Hide existing comments on the front-end

function disable_comments_hide_existing_comments($comments) {

    // Return an empty array to prevent displaying any comments

    $comments = array();

    return $comments;

}

// Filter to hide the comments on the front-end by returning an empty array

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

// Remove the comments page from the WordPress admin menu

function disable_comments_admin_menu() {

    // Remove the 'Comments' page from the admin menu to prevent access to it

    remove_menu_page('edit-comments.php');

}

// Hook into 'admin_menu' to remove the comments page from the admin interface

add_action('admin_menu', 'disable_comments_admin_menu');

// Redirect any user who tries to access the comments page in the WordPress admin area

function disable_comments_admin_menu_redirect() {

    global $pagenow;

    // If the user is trying to access the comments page, redirect them to the admin dashboard

    if ($pagenow === 'edit-comments.php') {

        wp_redirect(admin_url()); exit;

    }

}

// Hook into 'admin_init' to redirect users trying to access the comments page

add_action('admin_init', 'disable_comments_admin_menu_redirect');

// Remove the recent comments metabox from the WordPress admin dashboard

function disable_comments_dashboard() {

    // Remove the 'Recent Comments' metabox from the dashboard

    remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal');

}

// Hook into 'admin_init' to remove the recent comments metabox during admin initialization

add_action('admin_init', 'disable_comments_dashboard');

This code checks all post types (including custom post types) and removes support for comments and trackbacks. This means that comments will no longer be allowed across all posts, pages, and other post types on your site.

Now, click Save Changes to save the file.

How To Disable Comments On WordPress - Add Custom Code to Disable Comments

Important: Why do we recommend using a child theme? When you modify your functions.php file directly, any future theme updates will overwrite your changes. To prevent this, always use a child theme. A child theme allows you to add custom code and styles while keeping the parent theme intact. This way, when the parent theme is updated, your changes remain.

Alternative Ways to Manage Comments

Earlier, we showed you various ways to disable comments on WordPress. However, there might be a situation where you want to moderate them more effectively instead of disabling them entirely.

If you manage comments, you allow valuable user interaction while controlling spam and inappropriate content. One approach is to manually approve comments before they are posted, which can be done from your WordPress settings under Settings Discussion.

How To Disable Comments On WordPress - Comment Moderation Settings in WordPress

This feature lets you filter comments before they appear on your website, ensuring only relevant and appropriate comments are published.

Another effective solution is to use spam management tools like Akismet, which automatically detects and filters spammy comments. Akismet is one of the famous anti-spam plugins for WordPress, and it works by checking each comment against a global database of spam to block harmful or unwanted content.

Other alternatives include Antispam Bee, which offers robust spam protection while keeping legitimate comments intact.

These methods offer a balanced way to manage comments without completely disabling them, ensuring your website stays interactive while maintaining control over the content that gets published.

Strip Banner Text - Choose Hosted.com for the best WordPress Hosting & support. [Learn more]

FAQs

Can I disable comments on WordPress for specific pages or posts?

Yes. WordPress allows you to turn off comments for individual pages or posts. You can do this using the Quick Edit option or bulk editing posts.

Can I disable comments on WordPress for specific pages or posts?

You can turn off comments for all future posts by going to Settings Discussion in your WordPress dashboard and unchecking the option “Allow people to submit comments on new posts”.

Will disabling comments affect my existing comments?

When you disable comments on WordPress, new ones will no longer be allowed, but existing comments will remain visible unless you hide or delete them manually.

Can I use a plugin to disable comments on WordPress across my entire site?

Absolutely! Plugins like “Disable Comments” allow you to disable comments site-wide with just a few clicks. You can turn off comments on all posts, pages, or both.

Will disabling comments stop spam on my website?

Yes, disabling comments will prevent spammers from posting new comments. However, you can manually delete existing spam comments and install anti-spam tools like Akismet to help prevent future issues.

Can I re-enable comments after disabling them?

Yes. You can always re-enable comments for posts or pages by changing the discussion settings or editing individual posts to allow comments again.

Are there alternatives to disabling comments?

Instead of disabling comments, you can moderate them using tools like Akismet to reduce spam and unwanted content. Moderation gives you control over which comments are published.

Does disabling comments affect my SEO?

Disabling comments won’t directly affect your SEO. However, comments can contribute to fresh content on your site, which can benefit SEO. If you disable them, consider other ways to engage visitors.

Can I disable comments on WordPress using code?

Yes. You can manually disable comments on WordPress by adding code to your functions.php file. However, we recommend you use a child theme to avoid losing changes during theme updates.

How can I hide comments that have already been posted?

You can hide existing comments from the front end using a plugin or adding custom code to your theme. This prevents visitors from seeing previously posted comments without deleting them entirely.

WordPress Malware Removal: Manual & Automatic Methods

How to Install WordPress Themes: A Beginner’s Guide

How To Configure WordPress Error Logs: Identify & Fix Issues

How to Fix 502 Bad Gateway Error in WordPress

How to Fix the WordPress 500 Internal Server Error