how to completely disable comments in wordpress

## How to Completely Disable Comments in WordPress (The Ultimate Guide)

**By Naveed Ahmed**

For 15 years, I’ve been working with WordPress and its ecosystem. One common question I encounter is “How do I completely disable comments on my WordPress website?” While comments can be a great way to engage with your audience, they can also lead to spam, moderation headaches, and a less focused user experience.

This comprehensive guide will cover every aspect of disabling comments in WordPress, from simple settings to advanced code snippets, helping you create a comment-free zone for your website.

**Why Disable Comments?**

The reasons for disabling comments are diverse and depend on your website’s purpose and goals. Here are some common reasons:

* **Reducing Spam:** Comments can become a breeding ground for spam, requiring significant time and effort to moderate.
* **Maintaining Focus:** For certain websites, like portfolio or product landing pages, comments may detract from the primary message or user experience.
* **Minimizing Maintenance:** Managing comments can be time-consuming, especially on sites with a lot of traffic. Disabling comments eliminates this task entirely.
* **Controlling Content:** Some website owners prefer to have complete control over the content on their sites and don’t want user-generated comments.
* **Privacy Concerns:** Certain websites, especially those focused on personal topics or sensitive information, might choose to disable comments to protect their privacy.

**Methods to Completely Disable Comments**

Here are the most common methods for disabling comments in WordPress:

**1. Disable Comments on New Posts:**

The simplest method is to prevent comments from being added to future posts.

* Go to **Settings > Discussion** in your WordPress dashboard.
* Uncheck the box “Allow people to post comments on new articles.”
* Click “Save Changes.”

This setting will prevent comments from appearing on posts you create after making this change.

**2. Disable Comments on Specific Pages or Posts:**

You can choose to disable comments on individual pages or posts.

* Go to **Pages > All Pages** (or **Posts > All Posts**) to view your published content.
* Hover over the title of the page/post you want to modify and click “Edit.”
* On the right-hand side, click “Discussion” under the “Page” tab.
* Uncheck the box “Allow comments” to disable comments for that specific page/post.
* Click “Save” to apply your changes.

**3. Disable Comments on Pages and Posts in Bulk:**

To disable comments on multiple pages or posts at once, follow these steps:

* Go to **Posts > All Posts** (or **Pages > All Pages**).
* Select all the posts/pages you wish to modify.
* From the “Bulk Actions” dropdown, choose “Edit.”
* Click “Apply.”
* In the “Comments” dropdown, select “No” and click “Update.”

**4. Delete All WordPress Comments:**

Deleting existing comments is essential if you want to completely erase any trace of them.

* Go to **Comments** in the left-hand sidebar of your WordPress dashboard.
* Select all comments.
* From the “Bulk Actions” dropdown, choose “Move to Trash.”
* Click “Apply.”
* You may need to repeat this process if you have a large number of comments as WordPress only displays a certain number per page.

**5. Disable Comments on Media Pages:**

To prevent comments on media pages (image attachments, etc.):

* **Method 1 (Code Snippet):** Paste the following code into your theme’s `functions.php` file.

“`php
function filter_media_comment_status( $open, $post_id ) {
$post = get_post( $post_id );
if( $post->post_type == ‘attachment’ ) {
return false;
}
return $open;
}
add_filter( ‘comments_open’, ‘filter_media_comment_status’, 10 , 2 );
“`

* **Method 2 (WPCode Plugin):**

1. Install and activate the free WPCode plugin.
2. Go to **WPCode > Code Snippets > Add Your Custom Code (New Snippet)**.
3. Give your snippet a title, like “Disable Comments on Media Pages.”
4. Paste the code above into the “Code Preview” area.
5. Make sure “PHP Snippet” is selected in the “Code Type” dropdown and the switch is set to “Active.”
6. Click “Save Code Snippet.”

**6. Disable WordPress Comments Using a Free Plugin:**

The “Disable Comments” plugin provides a simple interface for disabling comments across your website.

* Install and activate the “Disable Comments” plugin.
* Go to **Settings > Disable Comments**.
* Choose “Everywhere” to disable comments on your entire site. The plugin will also remove the comments menu item from your WordPress admin area.
* Select “On specific post types” to disable comments on specific content types like posts, pages, or media.

**7. Remove “Comments Are Closed” in WordPress:**

If your WordPress theme doesn’t properly check the comment status, you might see the “Comments are closed” message even after disabling comments.

* **Method 1 (Theme Development):** Contact your theme developer to fix this issue, as it often requires theme-specific modifications.
* **Method 2 (File Renaming):**

1. Connect to your WordPress site via FTP or the file manager in your hosting control panel.
2. Navigate to your current theme’s folder, located in `/wp-content/themes/`.
3. Locate the `comments.php` file, right-click it, and rename it to `comments_old.php`.
4. Right-click in the right-hand panel of your FTP client and choose “Create New File.”
5. Name the new file `comments.php` and click “OK.”

This trick creates an empty comments template for your theme, preventing comments and related messages from displaying.

**Bonus Tip: Make Your Comments Section More Engaging**

Instead of completely disabling comments, consider using plugins like Thrive Comments to enhance your comment section.

* **Thrive Comments:** This plugin provides a modern and interactive comment experience.
* **Features:**
* Like/Dislike System: Users can upvote or downvote comments, encouraging engagement and highlighting popular opinions.
* Comment Editing: Users can edit their comments to correct mistakes or add content.
* Comment Subscriptions: Visitors can subscribe to comments and receive email notifications when new replies are added.
* Spam Protection: Includes spam prevention features to minimize the need for manual moderation.

**More Bonus Tips: Spam Protection Techniques**

If you’re concerned about spam, here are some additional techniques:

* **Akismet:** A popular WordPress plugin that filters out spam comments by checking them against a database.
* **Antispam Bee:** A plugin that uses an invisible honeypot to block bot spam.
* **Comment CAPTCHA:** Add a CAPTCHA or reCAPTCHA to your comment form to challenge bots and prevent automated spam.
* **Remove the Website URL Field:** Eliminate the website URL field from your comment form to discourage spammers from leaving links.
* **Block Malicious IPs:** Block specific IP addresses from accessing your website to prevent spam and hacking attempts.

**Conclusion**

Disabling comments in WordPress can be a valuable strategy for maintaining a clean, focused, and spam-free website. Whether you’re dealing with overwhelming spam, want to control the user experience, or simply prefer a comment-free environment, this guide provides a range of methods to achieve your goal.

**FAQs**

**

Can I disable comments on a specific category or tag?

**

While there isn’t a built-in way to disable comments based on categories or tags, you can achieve this using code snippets or plugins. Several plugins allow you to customize comment settings based on various factors, including categories and tags.

**

How do I remove the comment counter from my blog?

**

The comment counter is often controlled by your theme. You can try disabling comments for the entire site and see if this removes the counter. If not, you may need to contact your theme’s support for assistance.

**

How do I prevent users from inserting links with HTML tags and CSS modifications in comments?

**

WordPress automatically sanitizes comments, removing potentially dangerous HTML tags and CSS styles. You can further strengthen this protection by using plugins like Akismet or Antispam Bee.

**

What is the best way to block spam comments in WordPress?

**

Akismet is the industry-standard spam filter for WordPress. Combined with plugins like Antispam Bee, you can significantly reduce spam. Additionally, implementing CAPTCHA or reCAPTCHA can provide an extra layer of protection.

**

Can I disable comments for a specific period, like after 14 days?

**

Yes, you can use WordPress’s built-in “Close comments for articles older than” setting. Go to **Settings > Discussion** and enable this feature. You can set the time limit to close comments, such as 14 days, 180 days, or any other period you prefer.

**

Why doesn’t disabling comments remove the comment box on my site?

**

This could be due to a theme conflict, plugin conflict, or a custom code snippet you may have added. Check your theme’s settings, deactivate plugins, and review any custom code to identify the cause and make the necessary adjustments.

**

Is it possible to block specific IP addresses from commenting?

**

Yes, you can block specific IP addresses using various methods, including plugins, code snippets, and your hosting control panel. These methods can help prevent spam from known sources.

**

Can I stop users from commenting on media files?

**

Yes, you can disable comments on media files by using the code snippet provided in the article or by using the Disable Comments plugin and selecting “Media” under the “On specific post types” option.

**

What are some alternatives to completely disabling comments?

**

Instead of disabling comments entirely, you can consider using moderation tools to manage spam and negative comments. You can also limit comments to registered users, set comment moderation rules, or close comments after a specific period.

**

What if I’m using a custom theme, and the “Comments are closed” message still appears?

**

Contact your theme developer for support. They can help you identify the specific file to edit and provide guidance on removing the “Comments are closed” message.

**

Can I prevent users from leaving links in comments?

**

While WordPress automatically sanitizes comments, you can further restrict links using plugins or code snippets. You can configure plugins like Akismet to automatically remove links from comments or use a custom code snippet to disable the URL field in the comment form.

If you’re interested in learning more about tech news, feel free to visit my website: [www.naveedahmed.me](www.naveedahmed.me).

Posted in All
Need help for wordpress ?
Contact me
https://whatreligionisinfo.com/ https://uniquefunnynames.com/ unique funny names https://howdidcelebdie.com/