How to Effectively Disable Comments in WordPress

Why disable WordPress comments?

1. Spam

Spam usually refers to information that we don't need, and some people will intentionally send this type of information, which not only bothers the recipients, but may also cause them harm. Spam can also affect a website's performance in search engines, which in turn can damage a website's reputation.

图片[1]-如何在WordPress中有效禁用评论-光子波动网 | WordPress教程、Elementor教程与故障修复

2. Comments may be a security risk

Spam comments carry certain security risks, and many of them contain dangerous links that can install viruses, collect personal information, and steal money from people who click on them.

3. Shop operated without comment

When running an online store, there is no need to distribute the reviews section throughout the site. Some stores prefer to disable all reviews altogether, especially if the main purpose of the site is to list the items they sell.

4. you have a dedicated forum for people to have discussions

Disabling comments on WordPress doesn't mean you're cutting off all interaction between you and your visitors. It is possible to create a separate space for you and your visitors to interact with each other.

图片[2]-如何在WordPress中有效禁用评论-光子波动网 | WordPress教程、Elementor教程与故障修复

How do I disable comments on WordPress?

Method 1:Disable comments on all posts and pages in WordPress

  1. Go to the WordPress admin pageThe
  2. Click on "Comments". You'll see a list showing all the comments on the site.
  3. Check the checkbox in the upper left corner of the form, so that all comments can be selected.
  4. From "Batch operation"Select from the drop-down menu"To the wastebasket."The
  5. Click on "Apply"The
图片[3]-如何在WordPress中有效禁用评论-光子波动网 | WordPress教程、Elementor教程与故障修复

All existing comments on the site are now removed. However, the WordPress comment form still exists, allowing comments under your posts and pages, and the comment form can be disabled under each post and page.

The first option is to use thebatch operationThe

1. Navigate tocard>All Posts. You will see a table with all posts that have been published

图片[4]-如何在WordPress中有效禁用评论-光子波动网 | WordPress教程、Elementor教程与故障修复

2. Select all posts by checking the box in the upper left corner of the table. Select all posts from thebatch operationSelect from the drop-down boxEditor.

图片[5]-如何在WordPress中有效禁用评论-光子波动网 | WordPress教程、Elementor教程与故障修复

3. Clickappliance, found in the pop-up window"Comment."section, then select from the drop-down box "Not allowed".

4. Finally, the choiceupdateApply changes to article settings.

图片[6]-如何在WordPress中有效禁用评论-光子波动网 | WordPress教程、Elementor教程与故障修复

The second option is to use theDiscussion Settings

1. Go"Settings" > "Discussion"The

图片[7]-如何在WordPress中有效禁用评论-光子波动网 | WordPress教程、Elementor教程与故障修复

2. In"Discussion Settings" > "Other Comment Settings"Next, find the"Automatically closes comments on posts older than...days"Settings. Fill in the field0Comments can be turned off for all posts.

图片[8]-如何在WordPress中有效禁用评论-光子波动网 | WordPress教程、Elementor教程与故障修复

Method 2:Disable WordPress Comments on Future Posts

The first method turns off WordPress comments under your past posts and pages, but it won't stop people who want to comment on new posts. You can work around this issue by applying specific settings, though.

1. From the WordPress admin area, go toset up>talk overThe

2. InDefault Post SettingsUnder "Uncheck", uncheck theAllow people to submit comments on new postsFrame.

图片[9]-如何在WordPress中有效禁用评论-光子波动网 | WordPress教程、Elementor教程与故障修复

3. After applying the settings, your WordPress site will not allow people to comment under future posts.

Method 3:Disabling Comments on Specific WordPress Posts and Pages

If you only want to disable comments on a specific post or page, you can follow these steps:

  1. In the WordPress admin area and navigate to thecard>All PostsThe
  2. Find the posts you want to disable comments on and check their respective boxes.
  3. Select from the drop-down box"Edit", and then click the"Applications"The
  4. Make sure you're in the"Batch Edit"The right post was selected under.
  5. In the drop-down box, selectNot allowed.Then clickupdateThe
图片[10]-如何在WordPress中有效禁用评论-光子波动网 | WordPress教程、Elementor教程与故障修复

matching step (i.e. step by step)Method 1 The bulk editing part of the program is very similar. The difference is that you you only have to select the desired posts and pages instead of selecting them all.

Method 4:Disable WordPress comments on individual posts or pages

There are two ways to do this. The first option is to perform this from the WordPress post or page editor. The steps are pretty much the same whether you are using the Gutenberg editor or the Classic editor.

  1. In the right panel, scroll down until you find the"Discussion"Frame.
  2. UncheckComments allowedThe
  3. click (using a mouse or other pointing device)"Release."maybe"Renewal"Save changes.
图片[11]-如何在WordPress中有效禁用评论-光子波动网 | WordPress教程、Elementor教程与故障修复

It can also be done by clicking on the corresponding postQuick EditMake the disable setting.

图片[12]-如何在WordPress中有效禁用评论-光子波动网 | WordPress教程、Elementor教程与故障修复

Method 5:Disable media comments

When you upload media files to your website, WordPress automatically creates separate pages for them.

There are two ways to disable comments under media files, you can disable them individually, the first is similar to the way it works for posts and pages in method 4.

  1. In the WordPress admin panel, go to themedia, esp. news media>storehouseThe
  2. Locate the media file and select"Edit."The
  3. existtalk overUnder, cancelComments allowedThe
  4. click (using a mouse or other pointing device)updateThe
图片[13]-如何在WordPress中有效禁用评论-光子波动网 | WordPress教程、Elementor教程与故障修复

The second method to quickly disable comments under all media files on a website is to copy and paste the custom code into the theme'sfunctions.phpDocumentation.

The theme adds code snippets that may corrupt the site. To be on the safe side, make sure to create a backup of your site so that you can restore it to a previous version if something goes wrong. Also, consider creating a child theme that does not interfere with the settings of the parent theme.

1. In the WordPress admin panel, go toexterior condition>Theme File EditorThe

图片[14]-如何在WordPress中有效禁用评论-光子波动网 | WordPress教程、Elementor教程与故障修复

2. Open it and find it in the right-hand columnfunctions.php.

图片[15]-如何在WordPress中有效禁用评论-光子波动网 | WordPress教程、Elementor教程与故障修复

3. The following code fragment was then inserted into the document:

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

4. ClickUpdated documentsComplete the changes.

Method 6: Disable Comments with WordPress Plugin

utilizationDisable CommentsThe plugin makes it quicker and easier to disable comments.

  • In the wordpress dashboard, go to "plug-in (software component)">"Add New Plugin"
  • Type in the search fieldDisable CommentsPress enter to search
  • Select "Installation"and activate
图片[16]-如何在WordPress中有效禁用评论-光子波动网 | WordPress教程、Elementor教程与故障修复

After the plugin installation is complete, therefresh pageGo to the WordPress admin area of theset up>Disable comments.

Settings is divided into two tabs:"Disable comments"respond in singing"Delete comment". The former removes the comment form and the latter removes the comments you receive on your WordPress site.

图片[17]-如何在WordPress中有效禁用评论-光子波动网 | WordPress教程、Elementor教程与故障修复

exist"Disable comments"Under Settings, you can choose whether you want to turn off the "Everywhere."maybe"Specific Post Types" of theWordPress Comments.

On deleting the commentUnder Settings, there are three options. If you want to delete all comments on the site, select the"Everywhere".

If you want to keep some comments, select "On certain post types"to select the comments under the post type you want to delete.

To delete specific WordPress comments, such as those under WooCommerce product reviews, you can choose toDelete certain comment typesThe

Method 7:Disable comments via custom code

You can do this by copying and pasting several code snippets into the theme'spage.phprespond in singingsingle.phpfile to disable all comments on your WordPress site.

First, try replacing page.phpline of code in the file to turn off comments on all pages.

1. In the wordpress dashboard, go toexterior condition>Theme File EditorThe

2. Select the right-handpage.php.

图片[18]-如何在WordPress中有效禁用评论-光子波动网 | WordPress教程、Elementor教程与故障修复

3. Find the following code in the file:

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

Replace the code with the following code:

<! -- Begin Comment
 End Comment →?

4. ClickUpdated documents. Comments should be disabled on all your pages and posts.

Summary:

By describing the many ways to disable comments in WordPress, from a blanket ban to comment moderation on specific pages or posts, these steps can help site owners reduce spam and improve security.


Contact Us
Can't read the tutorial? Contact us for a free answer! Free help for personal, small business sites!
客服微信
Customer Service
Tel: 020-2206-9892
QQ咨询:1025174874
(iii) E-mail: [email protected]
Working hours: Monday to Friday, 9:30-18:30, holidays off
© Reprint statement
本文作者:红牛独立站
THE END
If you like it, support it.
kudos0 share (joys, benefits, privileges etc) with others
commentaries sofa-buying

Please log in to post a comment

    No comments