Comments Archives - PluginsForWP https://plugins-for-wp.world/blog/tag/comments/ Premium WordPress Plugins And Themes For An Affordable Price Sun, 21 Aug 2022 18:11:50 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.3 https://plugins-for-wp.world/wp-content/uploads/2020/01/cropped-Pluginsforwp-Favicon-32x32.jpg Comments Archives - PluginsForWP https://plugins-for-wp.world/blog/tag/comments/ 32 32 How to Turn Off Comments in WordPress in 5 Different Ways https://plugins-for-wp.world/blog/turn-off-comments-in-wordpress/ https://plugins-for-wp.world/blog/turn-off-comments-in-wordpress/#respond Tue, 08 Mar 2022 22:33:12 +0000 https://plugins-for-wp.world/?p=408517 WordPress has grown so much that it’s difficult to imagine it started as a blogging site. Statistics show that this platform is responsible for powering more than 39% of all websites. If you already have a WordPress site, you know that comments enhance website engagement. They allow readers to air out their opinions, driving traffic […]

The post How to Turn Off Comments in WordPress in 5 Different Ways appeared first on PluginsForWP.

]]>
WordPress has grown so much that it’s difficult to imagine it started as a blogging site. Statistics show that this platform is responsible for powering more than 39% of all websites.

If you already have a WordPress site, you know that comments enhance website engagement. They allow readers to air out their opinions, driving traffic to your blog while boosting SEO. This is why most people don’t find the need to turn off their comment section.

Welcome to the ultimate guide to WordPress site comments!

Why Do WordPress Site Owners Disable Comments?

There are both upsides and drawbacks to having comments on your site. For instance, most of the reactions you’ll find are spam and low-quality comments which injure your WordPress Website. In addition, maintaining your website and backing up data is also time-consuming, so freeing time to respond to comments will be difficult.

On the other hand, lacking any comments is suspicious to the web visitors and will negatively affect your website. This is because the comments section is the medium that connects bloggers to their users. So, why do site owners disable it?

To Get Rid of Spam Comments

The online world is lawless, and you will have to deal with unwanted content, from spam emails to spam comments. Spam links and low-quality comments injure your site. If left unchecked, they create the following negative consequences on your blog:

  • Making you rank lower on Google. Google locates terrible links in your comment section, reducing your ranking.
  • They are risking your visitor’s safety. For example, if your website visitor clicks on a spam comment, it may lead to a malicious link landing them in trouble.

Spam comments also slow your website loading time, reducing website traffic and keeping potential visitors away.

If you want to keep the comments box enabled but limit the number of spam comments, consider adding reCaptcha to the comments form.

To Enhance Website Performance

Turning off comments in WordPress significantly increases the performance of your site. Each opinion or comment needs a database request, which drags down your time. So, having a less bulky page will increase your site’s performance.

WordPress comments slow down your post’s loading page through the following process:

  • A database is queried to show existing comments
  • Every reaction created requires a database entry
  • Comments are to be received then processed by an outside browser
  • External resources like Gravatars are downloaded

In most instances, resources like JQuery and JavaScript have to be downloaded and processed.

To Save on Valuable Time

Comments on your posts are good for SEO, but they can harm your business if they consume your valuable time. Backing up data and managing your WordPress website already takes up much of your time. So if you also have to manage comments, especially the popular ones, this can take a toll on your business.

The thing about popular comments is that they attract tons of reactions, and if you do not have time to reply, your brand could suffer.

However, it’s important to note that not every website benefits from the comments section. For example, a business website will look less professional with a comments section. Therefore, it’s also ideal for turning off the comments section if a dedicated forum is designed to help your audience communicate.

We recommend that you consider your niche and audience before disabling comments.

There are various ways of disabling comments on your WordPress site, and here are all of them, step by step:

Method #1: Through Standard Dashboard Settings

The platform will enable comments on all posts if you have a WordPress site by default. Change this standard setting on your Dashboard to disable comments selectively or entirely on your posts.

First, go to your Dashboard -> Settings -> Discussion.

WordPress Discussion screen

To stop posts on all future posts, unselect the alternative reading, “Allow people to post comments on new articles.” Don’t forget to disable trackbacks and pingbacks. This will stop comments and notifications on everything you post in the future.

To remove all existing comments, read our how to delete all WordPress comments article.

Turn off comments from the Discussion screen

Method #2: Disable Comments Using a WordPress Plugin

If you are looking for a more elegant, swift solution, consider using a WordPress plugin. Unlike other methods, plugins give you complete control and eliminate the tedious clean-up process afterward.

Here are two main methods you should consider when installing a dedicated plugin:

Get a Premium Solution

Premium plugins are a great way to deal with your comment section. Our top recommendation is the Perfmatters Plugin (or get it from us for only $4.99). It is specifically tailored to enhance the performance of your website. It also comes with tweaks that reduce forthcoming slowdowns and a streamlined dashboard. Perfmatters also provides an easy solution to turning off your WordPress comments.

Here’s how to go about it:

Options tab > Settings > Disable comments section.

Disable comments with Perfmatters plugin

This is your perfect plugin if you only need to speed up your site’s website while having your WordPress comments turned off.

Install a Free Plugin

You can easily install a free plugin such as Disable Comments, allowing administrators to disable comments globally or for a particular post. This plugin has excellent reviews boasting a 4.9 out of 5-star rating.

Disable comments WordPress plugin

It is easy to use and comes with a million active installs. Install the plugin, then go to Settings to Disable Comments.

Install > Settings > Disable Comments.

You can also disable comments globally on your site with a simple click or turn them off for custom post types, pages, etc. With this feature, you’ll have disabled WordPress comments on WooCommerce products, media files, and pictures. Finally, please navigate to the Save Changes button and click on it.

Turn off comments with the disable comments plugin

You should, however, note that it’s impossible to override the settings simply by updating the standard WordPress Discussion settings to enable discussions or a particular post or page.

Therefore, it is advisable to use this solution for a site that has multiple users and you want to prevent access to the comment section.

You can also use other Plugins such as Akismet or WP Bruiser.

Method #3: Use Custom Code

This option is great if you no longer wish to use or install a plugin. Disabling your site’s comments utilizing this method is quite simple, especially if you have technical skills and experience. Here you’ll use basic HTML commands to dismiss the comments segment from appearing inside the WordPress theme. However, we recommend that you avoid editing the theme’s source code or risk a site breakdown if you do it incorrectly.

Please note: You should only use custom code if you’re conversant with the technical skills required.

First, create a child theme, followed by a site backup. Then disable comments on your site by copying and pasting code snippets to the pages of your themes, single.php file, and page.php. Here’s a quick step-by-step guide.

N/B: Do this on your page.php file using the following steps:

  1. Navigate to Appearance, located on the main Dashboard under Theme editor.
  2. Choose page.php
  3. Find the code on the file <?php comments_template( '', true ); ?> and replace it with <?php // comments_template( '', true ); ?>.
  4. You should then replace your single.php file using a line of code. This will help you disable all comments.
  5. The code you’ll find is <?php comments_template(); ?> And you should replace it with <?php // comments_template(); ?>.
  6. The final step is navigating to the Update File option, and you’ll be done.Turn off comments in WordPress template

Method #4: Disable Comments on Media

The WordPress platform often creates single pages every time you upload media files to your site. So, most of the time, you don’t need a comment section on media files. But, most times, you’ll find that pages receive comments like regular posts.

To disable them, you should:

  1. Navigate to the WordPress admin area > Media > Library
  2. Search for a media file and then select Edit
  3. Uncheck the “Allow Comments” Box under Discussion
  4. Click Update

This method is less suitable for sites with huge media libraries. It’s also impossible to apply this setting using Bulk Actions, as you would with custom posts and pages.

You should then turn off comments under all media files by using a custom code to the functions.php folder in your motif. Ensure you input the correct code snippets since incorrect codes can damage your site. We recommend you backup your site if something goes wrong.

  1. Navigate to the functions.php file by going to Appearance > Theme Editor
  2. On your right, choose the functions.php
  3. Copy and paste the code snippet below to your file
    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. Finally, Click Update FileDisable media comments in WordPress

Method #5: Disable Comments on Specific Posts or Pages

It is possible to turn off responses on posts and pages one by one instead of disabling them globally. The best thing about this method is its flexibility over comment sections. For instance, you can use it to override the current global setting. We recommend using it when you only want to change the comment settings for a particular post.

  1. Open the WordPress post or page. On your right-hand sidebar, you’ll see a section labeled Discussion. Open it.
  2. Disable comments by Unchecking the Allow Comments Box.
  3. Save the page or post, and you’re good to go!
Disable comment for specific posts and pages

You should note that the steps are the same irrespective of your editor. This method, however, does not remove pre-existing comments on the post or page.

Sometimes, with the Gutenberg editor, it’s challenging to find the Discussion box. So, navigate to the top right corner and click on the three-dotted button. Next, navigate to Preferences > Document Settings and then check again.

You can also use the Quick Edit feature, which is located in the admin menu under posts and pages.

  1. Navigate to Posts on your dashboard: All posts to make changes in your posts or Pages or All Pages for changes in your pages.
  2. To disable comments, get to the item title, then click “Quick Edit.”
  3. Deselect “Allow Comments.”
  4. Tick Update and save changes.
Disable comments quick edit screen

Generally, it’s easy to control comments on smaller websites by adjusting settings in WordPress or installing a plugin. Bulky websites, on the other hand, often require third-party solutions.

Conclusion

Choosing to enable or disable comments on your site depends on your niche, audience, and individual preference. Weigh the advantages and disadvantages of responses in your blog and make an informed decision based on your blog type. The ball is now on your court.

Will you keep your comments enabled or disabled? We are curious to know in our comments section below.

The post How to Turn Off Comments in WordPress in 5 Different Ways appeared first on PluginsForWP.

]]>
https://plugins-for-wp.world/blog/turn-off-comments-in-wordpress/feed/ 0
How to Add reCaptcha to WordPress Comments to Prevent Spam Comments https://plugins-for-wp.world/blog/add-recaptcha-to-wordpress-comments/ https://plugins-for-wp.world/blog/add-recaptcha-to-wordpress-comments/#comments Thu, 24 Jun 2021 15:25:31 +0000 https://plugins-for-wp.world/?p=378192 Spam comments on your blog posts will clog up your database and email account with false notifications. Believe us; we know all about it here. For months we received hundreds of spam comments every day. Luckily, we solve the problem by adding a reCaptcha box to the comments form. This article will teach you how […]

The post How to Add reCaptcha to WordPress Comments to Prevent Spam Comments appeared first on PluginsForWP.

]]>
Spam comments on your blog posts will clog up your database and email account with false notifications. Believe us; we know all about it here.

For months we received hundreds of spam comments every day. Luckily, we solve the problem by adding a reCaptcha box to the comments form.

This article will teach you how to add reCaptcha to your WordPress comment form to prevent spam messages.

What is Google reCaptcha?

reCaptcha is the box added to the form above the submit button and asking the user to prove that they are not a robot.

They are widespread and come in different verification options:

The most used one is the ‘I’m not a robot‘ checkmark, just like this one (that’s the one we use).

I am not a robot box

On the other hand, another popular one is proving that you are not a robot by selecting specific images from the same group as cars.

Select images

reCAPTCHA uses an advanced risk analysis engine and adaptive challenges to keep malicious software from engaging in abusive activities on your website. Meanwhile, legitimate users will be able to login, make purchases, view pages, or create accounts and fake users will be blocked.

Official Google reCaptcha website

Google reCaptcha Types

There are two versions of Google reCaptcha.

reCaptcha v2 – the box that appears inside the form (comments, login, register, etc.). They are the examples I showed you above, which is the version we will use in this tutorial.

The user will need to solve a challenge before submitting the form.

reCaptcha v3 – added to every page (or chosen pages) on your website and will analyze your behavior as a visitor. Human users act differently from bots (dah!!) and, therefore, be legit. It will be blocked if a robot tries to leave a comment or review.

reCaptcha v3

We only want to add a reCaptcha box to the WordPress comments form specifically instead of all pages. Therefore, we will use the reCaptcha v2 type.

Why Use reCaptcha?

As mentioned above, spam comments are not fun and can damage your website or admin’s experience.

Furthermore, spam comments will take space on your database and, if not deleted frequently, will clog and slow it down.

Also, if you get an email notification (like we do) for every comment left on your website, it will pile up quickly. That will slow down your workflow and keep you from focusing on critical emails.

Spam notification

We often skipped valuable comments left by legit users because we assumed they were spam comments. It doesn’t happen anymore after adding the reCaptcha form to our website.

Before we added the reCaptcha feature, we had two options, constantly delete all the comments or turn off WordPress comments altogether, and we didn’t want to do that.

After enabling the reCaptcha option, all comments are legit and approved when receiving comments.

Add reCaptcha to WordPress Comment Form

We can add reCaptcha in two different ways. The first way is by installing a plugin, and the second way is by using a PHP function. In this tutorial, we will cover both methods.

Regardless of your option, we will first need to generate our reCaptcha API keys.

Generate reCaptcha API Keys

Open the Google reCaptcha website and click the v3 Admin Console link to generate the keys.

Google reCaptcha website

Then, click on reCaptcha v2 and select the ‘I’m not a robot’ checkbox option. Enter your website’s domain name, accept the terms of service and click submit.

generate reCaptcha keys

You’ll have both the public and secret API keys on the next screen. Keep this window open, and we will need to copy them shortly.

reCaptcha API Keys

We can now move on to the second step and use the keys with a plugin or a function.

Add reCaptcha With a Plugin

The first way to add reCaptcha to your website is by using a plugin. First, from inside your WordPress dashboard, navigate to Plugins -> Add New, and install the reCaptcha by BestWebSoft plugin.

add reCaptcha with a plugin

Once activated, navigate to reCaptcha -> Settings, choose Version 2 and enter your site and secret keys generated on the last step.

Then, choose the forms you would like to enable reCaptcha for and scroll to the bottom of the page to save the changes.

reCaptcha plugin settings

Once saved, visit one of your blog posts, scroll to the comments section and see the added reCaptcha box.

reCaptcha was added to WordPress comment form

Follow the section below if you want to use a function instead of a plugin.

Add reCaptcha With a Function

We will use a PHP function to integrate reCaptcha with the comments form with this method.

First, navigate to Appearance -> Theme Editor and open the single.php (or singular.php) file of your child theme. Alternatively, you can also access the files by creating an FTP account.

If you don’t have a child theme yet, create one after reading how to make a WordPress child theme article.

Tip: please backup your website before editing core files.

Then, copy the code below and paste it just before the get_header(); function in the single.php file and click save.

wp_enqueue_script('google-recaptcha', 'https://www.google.com/recaptcha/api.js');

Once saved, open the functions.php file, scroll to the bottom of it, and paste the code below:

/* Add Google recaptcha to WordPress comment box */
function add_google_recaptcha($submit_field) {
    $submit_field['submit_field'] = '<div class="g-recaptcha" data-sitekey="enter_your_site_key_here"></div><br>' . $submit_field['submit_field'];
    return $submit_field;
}
if (!is_user_logged_in()) {
    add_filter('comment_form_defaults','add_google_recaptcha');
}
 
/** Google recaptcha check, validate and catch the spammer */
function is_valid_captcha($captcha) {
$captcha_postdata = http_build_query(array(
                            'secret' => 'enter_your_secret_key_here',
                            'response' => $captcha,
                            'remoteip' => $_SERVER['REMOTE_ADDR']));
$captcha_opts = array('http' => array(
                      'method'  => 'POST',
                      'header'  => 'Content-type: application/x-www-form-urlencoded',
                      'content' => $captcha_postdata));
$captcha_context  = stream_context_create($captcha_opts);
$captcha_response = json_decode(file_get_contents("https://www.google.com/recaptcha/api/siteverify" , false , $captcha_context), true);
if ($captcha_response['success'])
    return true;
else
    return false;
}
 
function verify_google_recaptcha() {
$recaptcha = $_POST['g-recaptcha-response'];
if (empty($recaptcha))
    wp_die( __("<b>ERROR:</b> please select <b>I'm not a robot!</b><p><a href='javascript:history.back()'>« Back</a></p>"));
else if (!is_valid_captcha($recaptcha))
    wp_die( __("<b>Go away SPAMMER!</b>"));
}
if (!is_user_logged_in()) {
    add_action('pre_comment_on_post', 'verify_google_recaptcha');
}

Make sure to replace ‘enter_your_site_key_here‘ and ‘enter_your_secret_key_here‘ with the actual keys, we generated earlier. Once replaced, click save.

Finally, visit the comments section on one of your blog posts and verify that the reCaptcha box was added successfully. Go ahead and test the box by leaving a comment.

Conclusion

In this article, you learned how to add a reCaptcha box to WordPress comments in two different ways.

Leave us a comment and tell us which one of the methods you chose to perform this task.

The post How to Add reCaptcha to WordPress Comments to Prevent Spam Comments appeared first on PluginsForWP.

]]>
https://plugins-for-wp.world/blog/add-recaptcha-to-wordpress-comments/feed/ 3
How to Delete All WordPress Comments – Easy and Simple https://plugins-for-wp.world/blog/wp-delete-all-comments/ https://plugins-for-wp.world/blog/wp-delete-all-comments/#respond Sun, 13 Sep 2020 17:52:49 +0000 https://plugins-for-wp.world/?p=21735 Comments are the best way to get feedback on your articles and keep interacting with your readers. While most visitors leave comments to share their thoughts with you, others use them to spam your website and promote their products or services. In this article, I will show you how to delete all WordPress comments in […]

The post How to Delete All WordPress Comments – Easy and Simple appeared first on PluginsForWP.

]]>
Comments are the best way to get feedback on your articles and keep interacting with your readers.

While most visitors leave comments to share their thoughts with you, others use them to spam your website and promote their products or services.

In this article, I will show you how to delete all WordPress comments in multiple different ways.

Reasons to Delete Comments

Not all the comments left on your website need to be displayed to the public and should be deleted.

Here are the main reasons why you should delete comments from your website.

  • Negative comments will affect the overall quality of the article conversation and prevent legit users from commenting.
  • Often, spam comments contain wrong links to shady websites. When a legit visitor clicks on one of these links, your business reputation will get damaged, and you won’t see the visitor again.
  • When search engine bots crawl your website and the spam links, your domain authority will get a hit, and your site score will decrease.

The Jetpack article can shed more light on how spam comments affect your website.

You will need to delete some or all your WP comments to prevent that from happening.

How to Delete All WordPress Comments

There are multiple ways to delete comments from WordPress, and in this article, I will show you three ways:

  • From inside WordPress native comments screen.
  • By using a plugin.
  • From inside the cPanel.

Although there are more ways to delete comments than the three methods above, they are the most common.

You can also reduce the number of spam comments by adding reCaptcha to the comments form or turning off comments in WordPress altogether.

Let’s start deleting the comments using the first way, from the comments screen.

Delete comments from the comments screen

This is my preferred method because you can use the native comments screen of WordPress.

Step #1: Open the comments screen.

From inside your WordPress dashboard, navigate to Comments.

Comments screen

You’ll see all the comments left on your different blog posts on the comment screen.

Step #2: Delete comments individually.

You can delete them individually by hovering on the comment you want to delete and clicking Trash.

Delete comments individually

Moreover, if you want to delete multiple comments, check all the comments you would like to delete, change the bulk actions to the trash, and click apply.

Delete multiple comments at once

Note: delete only the spam comments and not the legit ones. You can often identify the spam comments when it contains links in their body.

Step #3: Delete all comments.

By default, the comments screen shows you only 20 comments per page. Thus, if you have hundreds or even thousands of spam comments piled up, it will take a long time to go through the pages and delete them all.

You would like to display more than just 20 comments per page to speed up the process.

To achieve that, click on the screen options at the right top corner and change the number of items per page to a higher number.

Display more comments per page

Now you can delete even more comments at once.

Delete all comments with a plugin

In addition to the admin dashboard, we can also delete comments with a plugin.

From your WordPress dashboard, navigate to Plugins -> Add New, search for Delete All Comments of WordPress and install the first result on the left.

Delete all comments of wordpress

Once you activate the plugin, navigate to Tools -> Delete Comments.

Access the delete comments plugin screen

On that screen, you’ll have the option to delete all comments whatsoever or by filter:

  • In moderation
  • Approved
  • Spam
  • Trash

The Comments in moderations are the ones with the orange background waiting for approval. Most likely, they are the ones that you would like to delete.

Comment waiting for approval

Select your choice and click on Delete now.

Delete all comments with a plugin

Once clicked on Delete, please navigate to the comments screen to validate that you deleted them successfully.

Delete pending comments

Another great plugin you should be familiar with is Delete Pending Comments.

Delete pending comments plugin

This plugin allows you to bulk delete all pending comments with a click of a button.

Instead of selecting each comment individually or navigating between the many comment screens, we can delete them in one action. That’s a fantastic feature that can save you valuable time.

Thus, activate the plugin and navigate to the comments -> delete pending comments screen.

Once there, enter the I am sure I want to delete all pending comments, realize this can’t be undone text into the field, and click on the Delete Pending Comments button.

Delete pending comments

Clicking on the delete button will permanently delete all the pending comments from your site. You can then deactivate the plugin and reactivate it in the future when needed.

Delete all comments from inside the database

In this method, we will empty the comments column of our WordPress database. This is the most advanced way of the three; therefore, it’s not recommended.

First, log in to your website’s cPanel hosted on your server and click on the phpMyAdmin link.

WordPress data is stored in different tables in the database. The comments tables are stored in tables that are called comments and commentmeta.

Once you have found the tables, highlight them and click the Empty button on the right.

That’s it. All the comments inside the database tables were deleted successfully.

Conclusion

It’s a good practice to often delete comments from your WordPress website to maintain a healthy website.

In this article, you learned how to delete multiple comments in a few different ways.

Leave us a comment and let us know which one of the methods you used.

The post How to Delete All WordPress Comments – Easy and Simple appeared first on PluginsForWP.

]]>
https://plugins-for-wp.world/blog/wp-delete-all-comments/feed/ 0