Advertisements

How to Disable Comments in Wordpress

by jingji17

Comments on a WordPress website can be a double – edged sword. On one hand, they encourage interaction and community building, allowing readers to share their thoughts and opinions. On the other hand, they can attract spam, lead to heated arguments, and sometimes even slow down the website. There are various reasons why you might want to disable comments on your WordPress site. Maybe you’re running a corporate blog where you don’t need reader input, or perhaps you’re tired of dealing with comment spam. In this article, we’ll explore several ways to disable comments in WordPress, catering to different needs and levels of technical expertise.

Disabling Comments Site – Wide

Global Settings

The simplest way to disable comments site – wide is through the global settings in WordPress. First, log in to your WordPress dashboard. Navigate to the “Settings” menu and click on “Discussion”.

Advertisements

In the “Default article settings” section, you’ll find two checkboxes related to comments. Uncheck the box that says “Allow people to post comments on new articles”. This setting will ensure that any new posts you create will not have the option for comments enabled.

Advertisements

If you also want to disable trackbacks and pingbacks, uncheck the “Allow link notifications from other blogs (pingbacks and trackbacks) on new articles” checkbox. Trackbacks and pingbacks are essentially a way for other websites to notify your site when they link to your content. Disabling them can reduce the amount of unwanted traffic and potential spam.

Advertisements

After making these changes, scroll to the bottom of the page and click the “Save Changes” button. Now, all new posts will be created without the option for comments.

Advertisements

Plugin Method

If you prefer a more straightforward approach or if you want to have more control over the process, you can use a plugin. One popular plugin for this purpose is the “Disable Comments” plugin.

To install this plugin, go to your WordPress dashboard and click on “Plugins” in the left – hand menu. Then, click on “Add New”. In the search bar, type “Disable Comments”. The plugin should appear in the search results. Click on the “Install Now” button next to it.

Once the installation is complete, click on “Activate”. After activation, you’ll see a new menu item called “Disable Comments” in your dashboard. Click on it to access the plugin settings.

Here, you can choose to disable comments site – wide, for specific post types (such as pages or custom post types), or even for individual posts and pages. You can also set the plugin to automatically disable comments for future posts. This gives you a high level of flexibility in managing comments on your site.

Disabling Comments on Specific Posts or Pages

Manual Method

If you only want to disable comments on certain posts or pages, you can do so manually. Edit the post or page for which you want to disable comments.

On the right – hand side of the editing screen, you’ll see a panel called “Discussion”. If you don’t see it, click on the three – dot menu in the top – right corner of the screen and select “Discussion” from the list of available panels.

In the “Discussion” panel, uncheck the “Allow comments” checkbox. If you also want to disable trackbacks and pingbacks for this specific post or page, uncheck the “Allow pingbacks and trackbacks on this article” checkbox.

After making these changes, click on the “Update” button to save the changes to the post or page. Now, comments will be disabled only for this particular piece of content.

Bulk Editing

If you have a large number of posts or pages for which you want to disable comments, manual editing can be time – consuming. In such cases, you can use the bulk editing feature in WordPress.

Go to the “Posts” or “Pages” menu in your dashboard, depending on which type of content you want to edit. Select the posts or pages for which you want to disable comments by checking the checkboxes next to them.

At the top of the list, click on the “Bulk Actions” dropdown menu and select “Edit”. Then, click on the “Apply” button.

In the bulk edit options that appear, look for the “Discussion” section. Uncheck the “Allow comments” checkbox. You can also uncheck the “Allow pingbacks and trackbacks” checkbox if you want to disable them as well.

Once you’ve made the necessary changes, click on the “Update” button at the bottom of the page. WordPress will apply these changes to all the selected posts or pages.

Disabling Comments for Custom Post Types

Code Method

WordPress allows you to create custom post types, which can be useful for organizing different types of content on your site. If you want to disable comments for a custom post type, you’ll need to use some code.

First, you need to access your theme’s functions.php file. You can do this through the WordPress dashboard by going to “Appearance” > “Theme Editor” and selecting the functions.php file on the right – hand side.

Replace ‘your_custom_post_type’ with the actual name of your custom post type. This code will remove the support for comments and trackbacks from the specified custom post type.

Plugin for Custom Post Types

If you’re not comfortable working with code, there are plugins available that can help you manage comments for custom post types. One such plugin is “Comment Control”.

Install and activate the “Comment Control” plugin following the same process as described earlier for the “Disable Comments” plugin. After activation, go to the plugin settings.

In the settings, you’ll be able to see all the post types on your site, including custom post types. You can then choose to disable comments and trackbacks for specific post types by unchecking the relevant checkboxes. This provides a user – friendly way to manage comments for custom post types without having to write code.

Removing Existing Comments and Comment – Related Elements

Deleting Existing Comments

If you’ve decided to disable comments, you might also want to remove the existing comments from your site. To do this, go to the “Comments” menu in your WordPress dashboard.

Here, you’ll see a list of all the comments on your site. You can select individual comments by checking the checkboxes next to them and then click on the “Trash” button at the top to delete them.

If you want to delete all comments at once, you can use the “Bulk Actions” dropdown menu. Select “Trash” from the dropdown and then click on the “Apply” button. WordPress will move all the selected comments to the trash.

Removing Comment – Related Elements from the Theme

Even after disabling and deleting comments, there might still be some comment – related elements visible on your site, such as comment counts or comment forms. To remove these elements, you’ll need to edit your theme’s template files.

First, make a backup of your theme files in case something goes wrong. Then, access your theme’s template files through the WordPress dashboard by going to “Appearance” > “Theme Editor”.

Look for files like single.php (for single post templates) or page.php (for page templates). In these files, search for code related to comments, such as comments_template() or comments_number(). Remove or comment out these lines of code.

If you’re using a child theme, you can copy the relevant template files from the parent theme to the child theme and make the changes there. This way, your changes won’t be overwritten when the parent theme is updated.

Conclusion

Disabling comments in WordPress can be a simple or complex process depending on your specific needs. Whether you want to disable comments site – wide, on specific posts or pages, or for custom post types, there are multiple methods available. You can use the built – in WordPress settings, plugins, or even code to achieve the desired result. Additionally, you can clean up your site by removing existing comments and comment – related elements from your theme. By following the steps outlined in this article, you can effectively manage comments on your WordPress site and create a more streamlined and user – friendly experience for your visitors.

Related topics:

Advertisements

You may also like

DailyBlogWriting.com offers fresh, insightful content on various topics, providing readers with daily articles to inspire, inform, and entertain. From health tips to tech trends, we cover it all with a commitment to quality and engaging writing.

TAGS

Copyright © 2023 dailyblogwriting.com