如何在 WordPress 中禁用评论

有时您的 WordPress 网站不需要、想要或使用评论。意见很好,但也可能会分散注意力。

另一个原因可能是您不想处理所有与审核评论相关的垃圾邮件。在很多情况下,最好完全禁用 WordPress 评论。事实上,我们禁止在本网站上发表评论。

以下是您可以在 WordPress 和我们的 Perfmatters 插件中管理和禁用评论的几种方法。

全局禁用 WordPress 评论

按照以下步骤在您的 WordPress 网站上完全禁用评论。

步骤1

单击进入 Perfmatters 插件设置。

如何在 WordPress 中禁用评论
Perfmatters plugin settings

Step 2

Make sure you’re on the “General” tab.

如何在 WordPress 中禁用评论
Perfmatters General tab

Step 3

Under the “Options” section, scroll down and toggle on “Disable Comments.”

如何在 WordPress 中禁用评论
WordPress disable comments

Step 4

Scroll down and click “Save Changes.”

Below is a list of the actions that we attempt to perform when Disable Comments is toggled on:

  • Disable the built-in Recent Comments widget.
  • Remove the X-Pingback header.
  • Remove the comment feed links.
  • Disable comment feed requests.
  • Remove comment links from the admin bar.
  • Remove support for comments from all post types.
  • Close comment filters.
  • Remove comment links from the admin menu.
  • Disable built-in discussion page.
  • Hide comments from the dashboard.
  • Hide comment settings option from the profile page.
  • Return a blank comments template when requested.
  • Remove comment reply script.

The above feature will also hide the “Discussion” menu under “Settings.” It will not delete any existing comments; it will simply hide them. However, it does impact the individual discussion setting on posts/pages created after the feature is toggled on. If you need to re-enable comments, follow these steps.

Disable comments on a post or page

Note: The following will only work if you don’t have comments already disabled globally.

Comments can be disabled on any individual post or page. This is already an option in WordPress.

When editing a post or page in the Block Editor, click on the three dots at the top right. Then under “Options” make sure “Discussion” is checked (it might be already). In the Classic Editor, this is under “Screen Options.”

如何在 WordPress 中禁用评论
WordPress discussion options

Once enabled, uncheck “Allow comments” on the sidebar. In the Classic Editor, this is below the main editor window.

如何在 WordPress 中禁用评论
Uncheck allow comments

Disable comments on multiple posts or pages

Note: The following won’t work if you already have comments disabled globally.

You can disable comments on multiple posts or pages in bulk. Follow the steps below.

  1. Click on Posts in the admin sidebar and under posts, select “All Posts.” For Pages, click on “Pages → All Pages.”
  2. Check the posts you would like to disable comments for.
  3. Select “Edit” from the “Bulk Actions” at the top of the screen and click the “Apply” button.
  4. Under “Comments,” select “Do not allow” and click the “Update” button.

Disable future comments

Note: The following won’t work if you already have comments disabled globally.

You can disable comments on all future posts. Go to “Settings → Discussion” and uncheck “Allow people to submit comments on new posts.”

如何在 WordPress 中禁用评论
Discussion settings for posts

Automatically close comments

Note: The following won’t work if you already have comments disabled globally.

You can close comments automatically after a certain number of days have passed. Go to “Settings → Discussion.” Under the “Other comment settings” check “Automatically close comments on posts older than xx days.” Select the number of days you desire.

如何在 WordPress 中禁用评论
Automatically close comments

Another alternative option would be to remove comment URLs, instead of disabling comments altogether.

Re-enable comments

To re-enable comments on your WordPress site in bulk, follow the steps below. Note: This will change the “updated date” if you utilize that.

  1. Make sure the “Disable Comments” feature in Perfmatters is toggled off.
  2. Click on Posts in the admin sidebar and under posts, select “All Posts.” For Pages, click on “Pages → All Pages.”
  3. Check the posts you would like to re-enable comments for. If you have a lot of WordPress posts or pages, you can click on the “Screen Option” tab at the top and increase the number of items per page. You can then select all of the posts on the same page at once.
  4. Select “Edit” from the “Bulk Actions” at the top of the screen and click the “Apply” button.
  5. Under “Comments,” select “Allow” and click the “Update” button.
声明:本站资源绿色无后门无广告,可放心下载。如无特殊说明或标注,均为本站原创发布,转载请注明出处!