How to Disable Comments in WordPress: Complete Tutorial

Comments can significantly shape the experience and interaction on your WordPress site. They offer a platform for engagement, allowing visitors to voice their opinions and interact with your content. 

However, while enriching, this feature can also present challenges ranging from spam to high maintenance efforts. Deciding whether to enable or disable comments can influence your site’s functionality and user experience.

This tutorial will show you how to disable comments in WordPress, delete existing comments, and prevent new comments from appearing on old content.


How do I turn comments off in WordPress?

To turn off comments in WordPress, go to Settings > Discussion in your dashboard and uncheck the option to allow comments on new posts. For existing posts, disable comments by editing each post and unchecking ‘Allow comments’ in the Discussion settings. Plugins like Disable Comments can also disable comments site-wide or for specific post types.

How do I turn off comments and pings in WordPress?

To disable comments and pings, navigate to Settings > Discussion and uncheck the options for allowing comments and notifying blogs (pings) on new posts. For existing content, adjust these settings individually in each post’s edit screen or use bulk editing tools.

Can I turn off comments on my page?

Yes, you can disable comments on a specific page by opening the page in the WordPress editor, finding the Discussion section under Document settings, and unchecking Allow comments.

How do I disable HTML comments in WordPress?

To disable HTML in comments, add a custom filter to your theme’s functions.php file that strips HTML from comment content. For example:

add_filter('pre_comment_content', 'wp_strip_all_tags');

This code removes all HTML tags from comments. Alternatively, certain security plugins can manage HTML usage in comments.

Reasons to disable comments in WordPress

Even if you want to keep comments on in some form or fashion, learning how to disable comments in WordPress will help you decide what’s best for your site. Depending on your site’s needs and purpose, there are various cases where adapting the default WordPress comments functionality better serves site visitors.

They don’t suit the brand or the website’s purpose

For some websites, especially those in professional services, ecommerce, or portfolios, comments may not align with the brand’s image or the website’s purpose. Removing this feature can maintain a cleaner, more focused site presentation.

Combating spam and self-promotion

Unfortunately, comment sections can become targets for spam and self-promotion. Disabling comments helps prevent these nuisances, ensuring that your site remains reputable and your resources are not wasted on moderation.

Decreasing moderation efforts where comments aren’t needed

Managing comments may become an unnecessary overhead if your content doesn’t seek direct feedback or user interaction. Disabling comments can free up resources and streamline site management in such cases.

Enhancing site performance and load times

Comments can slow down your page loading times, particularly on popular posts with numerous comments. Disabling them can improve overall site performance and enhance user experience, especially for content-heavy sites.

Keep comments on social media

For large volumes of comments, keeping discussions on social media platforms can sometimes be more beneficial. It enables engagement in a more dynamic environment where your audience is already active and where tools for moderation and interaction are more robust.

Using a plugin to display comments

Opting to use a specialized plugin for managing comments can provide better control over settings and appearances, enhancing the way interactions are handled on your site.

How to disable comments in WordPress

Whether you want to disable comments on a single page or post or turn them off entirely, WordPress’s default comment features allow you to adapt the comment settings to suit your needs. Here’s how to disable comments in WordPress so that you can keep this feature only where it’s needed or get rid of comments everywhere.

Disable comments on a single page or post

To turn off comments for a single page or post: 

  1. Open the post or page in the WordPress editor. 
  2. Under the Document settings panel, locate the Discussion box.
    The WordPress editor's Post/Page settings sidebar's Discussion panel expanded to show the Allow comments option.

  3. Uncheck the Allow comments option. 
  4. Save or update the post to apply the changes.

Disabling comments for all posts and pages in the WordPress dashboard

Alternatively, you can disable the comments site-wide in the WordPress dashboard. Keep in mind that disabling comments in the dashboard won’t disable comments on existing pages and posts. To stop new comments on existing content, you must delete the old comments and turn off comments on existing pages and posts.

Disabling comments on future posts

  1. Navigate to the WordPress dashboard.
  2. Go to Settings > Discussion.
  3. Uncheck the option Allow people to submit comments on new posts.
    The WordPress dashboard's Discussion settings page showing the "allow people to submit comments on new posts" option highlighted in red.

  4. Click Save Changes to ensure that future posts won’t have comments enabled by default.

Disable comments on existing posts

  1. Use the bulk editor to disable comments on multiple posts or pages.
  2. Go to Posts and select All Posts.
  3. Use the Bulk Actions dropdown to edit multiple posts at once.
  4. Choose Edit and apply.
    Editing multiple posts in bulk to turn off comments in WordPress.
  5. Set the Comments option to Do not allow.
    The bulk editor's Comments dropdown menu is highlighted in red.

  6. Click Update to make the changes effective across selected posts.

Delete comments in bulk

With comments turned off in WordPress on existing and new posts and pages, it’s time to clean up old comments. Before you delete existing comments, you might want to export them and archive the data.

  1. Navigate to the Comments section in the dashboard.
  2. Select the comments you wish to delete using checkboxes.
  3. Choose Move to Trash from the Bulk Actions dropdown menu.
    Selecting multiple comments in the dashboard's Comments page. The bulk actions dropdown menu is highlighted in red.
  4. Click Apply to clean up unwanted comments in bulk.

Handling comments on media files

Frustratingly, WordPress allows comments by default on media files. That means every item in the Media Library has a page where users can potentially post comments.

Here’s how to disable comments in WordPress media files: 

  1. Go to Media in your dashboard. 
  2. Click on an item and select Edit more details
  3. Find the Discussion box similar to posts and pages and uncheck Allow comments.
    Turning off a media file's allow comments option displayed in the Media Library.
    If you don’t see the Discussion box, it may be hidden. To enable it, go to the Screen Options menu at the top right corner of the screen.
  4. Click Update to save the new settings.

Unfortunately, there’s no way to edit the Allow comments option in bulk. However, you can add a bit of code to your theme’s functions.php file to disable comments on media attachments.

Using an FTP client like FileZilla or your hosting provider’s File Manager, navigate to your site’s wp-content/themes/theme-folder and locate the functions.php file. Using a text editor, add the following code snippet to your functions.php file using a text editor, then save the file.

$post = get_post($post_id);
if ($post->post_type == 'attachment') {
    return false;
return $open;
add_filter('comments_open', 'disable_comments_on_media_attachments', 10, 2);

Plugins and tools for managing comments

Plugins like Disable Comments are highly effective for managing comments across a WordPress site comprehensively. This plugin allows you to systematically disable comments in WordPress on every post, page, or media file and provides options to remove related fields from the backend.

Here’s how you can install and use the plugin to disable comments across your site:

  1. In your WordPress dashboard, find the Plugins menu on the left-hand side and click on Add New. This will take you to the WordPress plugin repository.
  2. In the Add New Plugin page, use the search box to find “Disable Comments.” 
  3. You’ll see the Disable Comments plugin listed in the search results. Click on the Install Now button next to the plugin. WordPress will download and install the plugin.
    The WordPress dashboard's Plugins, Add New Plugin page displaying "disable comments" in the search box and the plugin's Install Now button highlighted in red.

  4. After the installation is complete, click the Activate button. This will activate the Disable Comments plugin on your site.

Once activated, navigate to Settings in your WordPress dashboard and click on Disable Comments

Step 1: Select the disable option

You will see several options for disabling comments. You can choose to disable comments on specific post types or everywhere.

The settings include: 

Everywhere: This will disable comments across your entire WordPress site. 

On certain post types: You can select specific post types (like posts, pages, media) where comments should be disabled.

The Disable Comments plugin's settings page with the plugin's two options highlighted in red: Everywhere or on specific posts, pages, or media.

Step 2: Disable comments on media

If you specifically want to disable comments on media files, ensure you check the box next to Media. This will apply the settings to all attachment pages.

Step 3: Save changes

After selecting your preferred options, click the Save Changes button at the bottom of the page to apply your settings.

At this point, new comments are disabled, but any posts or pages that have existing comments will still display them. If you want to remove any existing comments from your site, the Disable Comments plugin lets you delete comments in bulk. This option can be found under the same settings page and is useful for cleaning up unwanted comments after disabling.

How to remove the ‘Comments are closed’ message

After disabling comments, you may find a “Comments are closed” message in their place.

To remove this message, you’ll need to edit your theme files: 

  1. Access your theme’s comments.php file using an FTP client or your hosting provider’s File Manager.
  2. Look for the phrase Comments are closed within the PHP code. 
  3. Either remove or comment out this line of code to stop displaying the message. 
  4. Save and upload your changes.

Summing up

Comments can enhance interaction but also pose challenges such as maintenance and performance issues. Weighing their benefits against their drawbacks in the context of your specific site needs is crucial. Understanding these factors will help you optimize your WordPress site for better performance and user engagement, whether you choose to disable comments or manage them through plugins.

Simplify WordPress with 10Web

Share article

Leave a comment

Your email address will not be published. Required fields are marked *

Your email address will never be published or shared. Required fields are marked *


Name *