banner



How To Disable Comments On Wordpress Blog Pages

Website comments aren't for everyone.

On the one hand, they can be an effective way to engage visitors and build a community on your WordPress website. But a comments section can also be a breeding ground for spam, harmful links, and sometimes self-promotional or even offensive remarks. And some WordPress sites simply just don't need comments.

Fortunately, WordPress allows users with the Administrator role to easily manage comment sections on their site, and even disable them on some or all of your web pages if needed.

Grow Your Business With HubSpot's Tools for WordPress Websites

In this post, I'll discuss why an Administrator might choose to disable some or all comments. Then, I'll explain how to disable comments on:

  • individual pages and posts
  • multiple pages and posts
  • all pages and posts on your site
  • media attachments

Why Disable Comments in WordPress?

While comments can be a nice addition to your website content, they're by no means a requirement for a successful online presence. Here are some reasons to shut down commenting on a WordPress page, post, or entire site:

    • To prevent spam: Almost a quarter of internet traffic comes from bad bots. To prevent these attacks from affecting your comment section, consider getting rid of comments altogether or installing a security plugin.
    • To save time: Moderating your comments and responding to them is important work for engaging and safe, but it also uses up valuable time.
    • You designated a space for comments elsewhere, like social media or a WordPress forum.
    • Most static pages don't need comments, especially your main pages like your home page, about page, contact page, and pages describing your business and product. WordPress automatically disables comments on pages, so this isn't an issue unless you've changed this default setting.
    • You prefer to use a commenting plugin to handle comments and replace WP's default comment feature.
    • To increase page speed performance. You might instead consider lazy loading your comments as an alternative to boost performance without cutting comments.
    • They aren't needed on a WordPress post. For example, you might not want a comment section on an announcement post.
  • They don't serve website goals or brand. You might just prefer not to have comments on your posts if you believe they won't add value to your content. Comments could even make your site appear unprofessional if unmoderated and inappropriate.

Ultimately, the choice to disable comments is up to you, based on the specific goals of your website. Use your best judgment here — you can always turn comments off or back on if needed.

How to Disable Comments in WordPress

You can change the default comment settings in WordPress for individual pages and posts, for multiple pages and posts at a time, or for your entire WordPress site. You can also configure other settings, like comment moderation and comment notifications, in the WordPress discussion settings.

By default, WordPress prevents comments on pages and allows comments on posts. This is because you likely won't want comments on your main pages, like your homepage, but might still want comments on content like blog posts.

How to Disable Comments on a Single Post or Page in WordPress

Sometimes, you might want to keep comments active across your site, but turn them off for specific posts.

To disable comments on an individual post or page:

  1. Select Posts > All Posts or Page > All Pages in the left side panel of the dashboard.
  2. Hover over the specific post and select Edit.
  3. Under the Discussion section in the right panel, uncheck the box next to Allow comments.
  4. Click Update.

the wordpress page builder settings menu where users disable comments

Disabling comments on a page or post won't get rid of existing comments.

To delete an existing comment:

  1. Select Comments from the dashboard.
  2. Hover over the comment you want to delete and click Trash.

How to Disable Comments on Multiple Pages or Posts in WordPress

To disable comments on multiple pages or posts at a time:

  1. Select Pages > All Pages or Posts > All Posts from the dashboard.
  2. Check the boxes of all posts you want to edit.
  3. In the Bulk Actions dropdown menu, select Edit, then Apply.
  4. In the Comments dropdown menu, select Do not allow.
  5. Click Update.

    the bulk edit options for WordPress posts where users can disable comments

How to Disable Comments Globally in WordPress

Turning off all commenting on a WordPress site is a three-step process: disabling comments on new posts, disabling comments on old posts, and (if you want) deleting some or all existing comments.

To disable all comments on future posts:

  1. Select Settings > Discussion from the dashboard.
  2. Uncheck the box next to Allow people to post comments on new articles.

Click Save Changes at the bottom of the page.

the discussion settings menu in wordpress where users can disable comments

To disable comments on existing posts:

  1. Select Settings > Discussion from the dashboard.
  2. Check the box next to Automatically close comments on articles older than _ days and set the number of days to zero.
  3. Click Save Changes at the bottom of the page.

To delete existing comments on your site:

  1. Select Comments from the dashboard.
  2. Check the boxes of all comments you want to delete.
  3. Select Bulk Actions > Move to Trash.
  4. Click Apply.

How to Disable Comments on Media Files in WordPress

Even after disabling comments on your posts and pages, your media files will continue to be open for comments. You can disable comments on individual media attachments from the Media Library, or in bulk by altering some source code.

To disable comments on a single media attachment:

  1. Select Media > Library from the dashboard.
  2. Click the media item you want to edit.
  3. Select Edit more details in the right panel.
  4. Under the Discussion section, uncheck the box next to Allow comments. This region might be hidden. If so, display it by selecting Discussion in Screen Options.
  5. In the Save section, click Update.

the edit media page in wordpress where users can disable comments

If you have many media attachments on your site, this can take time. Consider disabling comments on all media at once with a bit of code.

To disable comments for all media attachments on your site:

  1. Open the "functions.php" file of your WordPress theme.
  2. Paste the following code at the bottom of the file, then save the file:
                                          

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 );

How to Disable Comments With a WordPress Plugin

WordPress core allows you to disable comments and edit other comment settings through its interface, but you might prefer a plugin for disabling your website's comments instead. Disable Comments is a popular and reputable plugin for turning off all comments on your WordPress site with a click.

To disable comments globally with the Disable Comments plugin:

  1. Install the plugin from the download page.
  2. After installation, select Settings > Disable Comments from your dashboard.
  3. From here you can disable comments on all pages, posts, and media. You can also disable comments only on certain post types.
  4. Click Save Changes.

menu for the Disable Comments WordPress plugin

Source

How to Remove the 'Comments Are Closed' Message in WordPress

After you disable comments, your pages might display a "comments are closed" message at the bottom. To get rid of this message:

  1. Connect to your WordPress site using an FTP client.
  2. Open the current theme folder, which is in the directory "/wp-content/themes/".
  3. Find the file "comments.php" and rename it to "comments_old.php".
  4. Create a new file and name it "comments.php". Doing this should remove the message.

If your theme doesn't have a "comments.php" file, contact the theme's developer and ask them how to best solve this problem.

Comments work for some websites and not others. It's up to your own preference and whether you see comments as beneficial. You can still provide quality content without comments to reaffirm — let visitors decide for themselves whether your site is worth returning to.

Use HubSpot tools on your WordPress website and connect the two platforms  without dealing with code. Click here to learn more.

Use HubSpot tools on your WordPress website and connect the two platforms  without dealing with code. Click here to learn more.

Originally published Aug 5, 2020 7:33:00 PM, updated August 14 2020

How To Disable Comments On Wordpress Blog Pages

Source: https://blog.hubspot.com/website/disable-comments-wordpress

Posted by: hennesseybecomeavoing.blogspot.com

0 Response to "How To Disable Comments On Wordpress Blog Pages"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel