How to disable comments in WordPress

In its early days, WordPress was primarily a blogging platform, so it was important that people could comment on posts. Since then, the tool has grown in popularity and is now used to design many different types of websites – including sites that don’t need a comment function.

Tip

IONOS offers WordPress hosting packages to help users create sites quickly, easily, and securely. The packages include comprehensive support and are suitable for any kind of website, online shop or web platform.

Whether you want to disable comments for specific pages or posts or for your whole site, WordPress has simplified the process. All it takes is a few mouse clicks. The quickest and easiest way to turn off comments in WordPress is via the settings in the backend. Alternatively, you can use a plugin or edit certain lines in your WordPress code.

How to disable WordPress comments for your entire site

By default, WordPress comments are disabled on pages but enabled on posts. If your website only contains pages (and no posts), you don’t need to turn off comments manually.

Note

WordPress websites can contain both dynamic content (“posts”) and static content (“pages”). On pages, the content doesn’t change, whereas for posts, the content is rearranged each time a new post is added. Most “standard” websites created today mainly use pages. Posts are used when content is constantly being added, because they display new content at the top and shift older articles down the page.

Here’s how to turn off comments for all of the posts on your WordPress website:

Step 1: Log in to the backend and go to “Settings”, then “Discussion”.

Step 2: In the right-hand pane, uncheck “Allow people to post comments on new articles”. This means nobody will be able to comment on new content you upload, but that doesn’t stop them commenting on older posts. For that to be the case, another step is required.

Step 3: Check the “Automatically close comments on articles older than [14] days” option and change the number of days to “0” instead of “14”. This will effectively remove any existing comments so that they are no longer visible. Don’t forget to click on “Save Changes” at the bottom of the page to confirm your new settings.

Once you’ve made the changes, it’s a good idea to check that comments are indeed disabled on all of your posts.

How to disable WordPress comments for specific posts and pages via “Quick Edit”

You can turn WordPress comments on and off for specific posts and pages using the “Quick Edit” function in the backend. As mentioned above, by default, comments are enabled for pages and for posts.

How to disable WordPress comments for specific posts using “Quick Edit”

Step 1: Log in to the backend and click on “Posts” > “All Posts” in the left sidebar. All of your posts will now be displayed in a list.

Step 2: Hover your mouse over the post for which you want to disable commenting. The following buttons will appear below the post title: “Edit”, “Quick Edit”, “Trash”, and “View”. Click on “Quick Edit”.

Step 3: Clicking on “Quick Edit” opens up a settings page for the post in question. Uncheck “Allow Comments” and then click on the “Update” button. This will prevent people from adding new comments to the post.

How to enable WordPress comments for specific pages using the “Quick Edit” function

By default, comments are disabled on all WordPress pages but you can turn them back on with just a few clicks. The steps are very similar to those above for WordPress posts.

Step 1: Log in to the backend and go to “Pages”, then “All Pages”. All of the pages of your site will be displayed in a list.

Step 2: Find the relevant page and hover over it with your mouse. A set of buttons will now appear below the page name. Click on “Quick Edit”.

Step 3: In the settings page that opens, check the “Allow Comments” option and then click on the blue “Update” button to confirm your changes. Visitors will now be able to comment on the page in question. If you change your mind and want to turn off commenting, simply go back into the settings, uncheck “Allow Comments” and click on “Update”.

How to disable WordPress comments for specific posts or pages using Gutenberg

Another very simple way of enabling or disabling comments on your WordPress site is to use Gutenberg, which is the default editor in the latest versions of WordPress.

Step 1: Go into the backend and open the list of your pages or posts (“Pages > “All Pages” or “Posts” > “All Posts” respectively). Find the page or post you want to edit and click on its title.

Step 2: The page or post in question will now open in the Gutenberg editor. In the right-hand pane (the “Infobox”), click on “Document” and then on “Discussion”. This section contains an “Allow Comments” option that you can check or uncheck as appropriate. As always, remember to click on “Update” to save your changes.

Tip

Did you know that WordPress also allows you to add contact forms? Find out more in our contact form plugin comparison! 

The options listed above allow you to disable new comments on specific WordPress posts or pages, or remove comments completely. However, depending on the structure of your site, you might have no other option but to delete existing comments individually if you no longer want visitors to see them.

How to disable WordPress comments using a plugin

WordPress offers several easy ways to disable and manage comments. However, if these aren’t sufficient, you can install a plugin designed specifically for this purpose. One of the most popular choices for making WordPress comments disappear is “Disable Comments” by Samir Shah – it’s currently installed on more than one million WordPress sites! The plugin is ideal if you’re looking for a quick and easy way of disabling comments, and removing all comment-related controls and settings from both the frontend and the backend.

As well as the popular “Disable Comments” plugin, there are a number of other plugins that let you adjust various comment settings in WordPress.

How to disable WordPress comments using code

If you’re able to edit the code of your WordPress site, there are lots of things you can do, and that includes managing comments. When it comes to comments, there are usually simpler ways of achieving your goal, but if you still want to modify your code, here’s what to do. First, create a backup of your WordPress site so that you can restore your pages if anything goes wrong.

How to disable commenting for all pages using code

To disable commenting on all of your WordPress pages and remove existing comments, open the page.php file and find the following lines of code:

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

Replace these lines with the following code snippet:

<!-- Begin Comment</codesnippet>-->
<!--?php comments_template( '', true ); ?-->
End Comment -->

How to disable commenting for all posts using code

The steps are similar for posts. Open the single.php file and find the following lines:

<!--?php comments_template(); ?-->

Replace them with the following snippet:

<!-- Begin Comment</codesnippet>-->
<!--?php comments_template(); ?-->
End Comment -->

If you’ve inserted both snippets correctly, comments will now be disabled on all of your WordPress pages and posts. However, a WordPress site can also contain other types of content, for example “Media”. It’s, therefore, best to check whether comments have definitely been disabled or deleted in all the right places.

Note

To find out more about WordPress, check out our guides on the best WordPress themes and WordPress security plugins as well as how to duplicate WordPress pages and WordPress quiz plugins.

Was this article helpful?
We use cookies on our website to provide you with the best possible user experience. By continuing to use our website or services, you agree to their use. More Information.
Page top