Tag - Comments

How to Turn Off Comments Notifications in WordPress


Do you want to turn off comment notifications on your WordPress site?

By default, WordPress notifies the site administrators when there is a new comment on the site.

If you are just starting a new blog, then this feature will alert you of new comments that you can respond to and increase user engagement.

However, these comment notifications could become annoying as your blog grows because you would start getting a lot of them.

Luckily, there is an easy way to disable WordPress comment notification emails. In this article, we will show you how to easily turn off comment notifications in WordPress.

Turning Off Comment Notification Emails in WordPress

How to Turn Off Comment Notification in WordPress (Step by Step)

First of all, you need to login to your WordPress admin area and go to Settings » Discussion page. From here, scroll down to ‘E-mail me whenever’ section where you will see these two checkbox options:

  • Anyone posts a comment
  • A comment is held for moderation

Default WordPress comment email notifications

As shown in the image above, the comment notification emails are enabled by default in WordPress.

Disable Comment Notification Emails in WordPress

To disable comment notifications, you need to uncheck both boxes, and then click on the ‘Save Changes’ button at the bottom of the page.

That’s all!

WordPress will now stop sending comment notification emails to the site administrators and post authors.

If you want more tips to improve your WordPress comment notifications, then you can see our guide on how to how to manage WordPress comment notifications emails.

Turning Off Comment Notification Emails from Other WordPress Websites

Are you receiving comment notification emails from websites other than yours?

If you have commented on a post on another blog and subscribed to its comments, then you will receive comment notification emails every time a new comment is added to the post.

Many blogs nowadays use a plugin like Subscribe to Comments Reloaded to add a comment subscription option in their comment box.

You probably checked or forgot to uncheck the comment subscribe option.

For example, you can see ‘subscribe to comments’ option under the comments section of this article.

Subscribe to Comments in WPBeginner Blog

It is useful if you have asked a support question and waiting for a response from the post author. But if you posted a general feedback comment, then it can distract you unnecessarily.

You can unsubscribe to such comment notification emails by merely clicking on the unsubscribe link in the email.

We hope this article helped you to learn how to turn off comment notifications in WordPress. You may also want to see our guide on how to completely disable comments in WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.



Source link

How to Display the Total Number of Comments in WordPress


Do you want to display the total number of comments on your WordPress site?

Comments allow users to participate and engage with the content on your website. By showing off the total comment count, you can encourage more users to join the conversation.

In this article, we will show you how to easily display the total number of comments in WordPress, with or without a plugin.

How to display total number of comments in WordPress

Display WordPress Comment Count using a Plugin

This method is easier and it is recommended for all users. Instead of writing code, you’ll be using a plugin to display comment count in WordPress.

First, you need to install and activate the Simple Blog Stats plugin. You may read our step by step guide on how to install a WordPress plugin for detailed instructions.

Upon activation, go to Settings » Simple Blog Stats page to configure plugin settings.

Simple Blog Stats Plugin settings page

On this page, you’ll see all the shortcodes that you can use to show different stats like the total number of comments, registered users, number of posts, categories, page count, and more.

You need to copy the shortcode [sbs_approved] to display the total number of approved comments on your WordPress site.

If you want to display it in a post or page, then simply create a new post or edit an existing one.

On the post edit screen, you need to add the shortcode block in the WordPress content editor.

Add Shortcode Block to a WordPress Page

You can do this by clicking on the Add block (+) icon and then search for the shortcode block. Once you find it, you need to click on it to add the shortcode block to the editor.

Next, you need to paste the shortcode [sbs_approved] inside the block settings.

Paste Shortcode to the Shortcode Block

You can add any text you want to display before or after the shortcode.

Alternatively, you can also use the shortcode inside a paragraph block. Simply copy and paste the shortcode where you want to display the comment count.

Paragraph block with comment count shortcode inside it

Using the paragraph block will also allow you to use the text styling option available in the WordPress block editor.

Once you are done, click on the publish or update button to save your changes. You can now visit your website to see your changes in action.

Comment count displayed in a WordPress post

Displaying total comment count in a sidebar widget

You can also use the same shortcode inside a WordPress widget and display it in your blog’s sidebar.

Simply head over to the Appearance » Widgets page and add a ‘Text’ widget to the sidebar.

Text widget with comment count shortcode inside it

Next, go ahead and paste your shortcode inside the ‘Text’ widget.

Don’t forget to click on the ‘Save’ button to store your widget settings.

You can now visit your website to see the widget in action.

Sidebar comment count in WordPress

Display WordPress Comment Count (without a plugin)

If you don’t want to use a plugin, then you can use display the total comment count manually.

This method requires you to add a code snippet to your website. If you haven’t done this before, then please check out our guide on how to copy and paste code snippets in WordPress.

Before you do anything, you should make a full backup of your website. This will help you to restore your site in case you break anything while editing the theme files.

Now you need to add the following code to your theme’s functions.php file or a site-specific plugin:



function wpb_comment_count()  
$comments_count = wp_count_comments();
$message =  'There are <strong>'.  $comments_count->approved . '</strong> comments posted by our users.';

return $message; 
 

add_shortcode('wpb_total_comments','wpb_comment_count'); 


This code creates a function that outputs the total number of approved WordPress comments on your site. It also creates a shortcode to display it.

You can now use the shortcode [wpb_total_comments] in your posts, pages, or a text widget to display the total number of comments on your website.

This is how it looked on our demo site:

Preview of comment numbers

We hope this article helped you display the total number of comments on your WordPress site. You may also want to check out our guide on how to prevent comment spam in WordPress and the best WordPress plugins for every website.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.



Source link

How to Allow Users to Edit their Comments in WordPress


Have you ever felt the need to edit a comment you just left on a website?

Maybe you want to correct a spelling or grammar or error, or maybe you accidentally hit the submit button before finishing your comment.

It happens to all of us. The problem is that most WordPress sites do not allow users to edit their comments once they are published.

If you receive a lot of comments on your website, then you may want to consider allowing users to edit their own comments for a short period of time.

In this article, we’ll show you how to allow users to easily edit their comments in WordPress for a short period of time.

How to Allow Users to Edit their Ccomment in WordPress

Why Allow Users to Edit or Delete their Comments

Most WordPress sites allow users to submit comments on their articles after providing their name and email address. However, users are not allowed to edit or delete their comment.

Sometimes, people want to make changes to their comment after clicking on the submit button.

The most common scenario is to fix their mistakes like a spelling or a grammatical error. Some users may want to modify their comments to add or remove something.

There can also be some rare cases where a user may think about deleting their comment because what they wrote was is completely out of context.

Whatever the case may be, the best solution can be to allow people to edit their comments for a short period of time, maybe for the first 5 or 10 minutes.

During that time, they’ll be allowed to modify or even delete their comments.

The reason for adding the time limit is to make sure that link builders and spammers don’t abuse the comment section by adding links to their approved comments.

That being said, let’s take a look at how to easily allow users to edit their comments in WordPress.

Allowing Users to Edit Comments in WordPress

First thing you need to do is install and activate the Simple Comment Editing plugin. You can see our step by step guide on how to install a WordPress plugin for detailed instructions.

Upon activation, the plugin will allow your users to make changes to their comments within the first 5 minutes.

After the first 5 minutes, users will not able to edit their comments.

You can change this time limit by going to Settings » Simple Comment Editing in your WordPress admin area.

Simple Comment Editing plugin settings

On the settings page, you can change the time in the text field to anything you like.

However, it is recommended to set the limit under 30 minutes since the purpose is to allow users to fix the errors right away.

Once you’ve changed the time, you need to click on the Save Options button to store the changes.

Next, we recommend leaving a test comment on any of your posts, so you can see the plugin in action.

WordPress comment click to edit option

Once you’ve submitted your comment, you’ll find the “Click to Edit” link and a countdown timer below the comment text. The timer is useful for indicating the time within which you can edit your comment.

To modify your comment, you need to click on the Click to Edit link.

This will allow you to make changes to your comment. However, you’ll not be allowed to change your name, email, or website URL.

Edit comment with countdown timer

Once you’re done, you need to click on the Save button to update the comment.

If you want to delete your comment, then you have to click on the Delete button. This will open an alert box asking you to confirm that you want to delete your comment.

Allow users to delete their comments

Go ahead to click on OK to complete the process.

That’s all! We hope that this article helped you to learn how to allow users to edit their own comments in WordPress for a short period of time.

You may also want to see our guide on how to style the comment form of your WordPress site.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Allow Users to Edit their Comments in WordPress appeared first on WPBeginner.



Source link

How to Completely Disable Comments in WordPress (Ultimate Guide)


Are you wondering how to turn off WordPress comments? While comments are a great way to interact with your site visitors, some website owners don’t want to allow comments on their site.

Thanks to WordPress, you have the ability to either disable comments on specific posts, pages, custom post types, or even completely remove comments from your entire website.

In this article, we’ll show you the step by step process on how to disable comments in WordPress.

How to Completely Disable Comments in WordPress

Why Disable Comments in WordPress?

Many small business owners use WordPress to create their website. These business websites often doesn’t have a blog section and mostly has static pages like services, about us, contact, etc. In such cases, it doesn’t make sense to allow comments at all.

In other cases, bloggers may publish certain posts like announcements that they don’t want to allow comments to trolls. In these cases, you can easily disable comments on those specific posts or pages.

The other scenario is some business blogs choose to disable comments entirely to prevent spam. Although you can always use spam protection techniques (which we’ll share later in this article), disabling the comment section will definitely solve the problem.

Whatever your reason may be, you can certainly disable comments and even remove the comment section from your WordPress site.

Here’s a quick overview of what you’ll learn in this article:

  • Disable Comments on Future Posts
  • Disable Comments on a Specific Page or Post
  • Disable Comments on Pages and Posts in Bulk
  • Delete All WordPress Comments
  • Disable Comments on Media
  • Disable WordPress Comments Sitewide using a Plugin
  • Remove “Comments are closed” in WordPress
  • Spam Protection Techniques

The first few methods will explain how you can disable comments on pages, posts, or media without using a plugin. We’ll later explain how to remove the comment section from your WordPress site with the help of a plugin.

With that said, let’s take a look at various ways to disable comments in WordPress.

Disable Comments on Future Posts

If you’ve just started your WordPress site, you can easily stop comments on your future posts.

To do that, go to Settings » Discussion from the left sidebar of your WordPress admin panel.

On this page, you need to uncheck the option that says “Allow people to post comments on new articles” and then click on the Save Changes button to store your settings.

Disable comments on future posts

This will disable comments on all your future posts. However, if you want to allow or disallow comments on a specific post, then you can still do it without changing this setting.

We’ll cover that in the next section.

Disable Comments on a Specific Page or Post

By default, comments are turned off on all your pages.

However, WordPress gives you the freedom to enable or disable comments on individual pages and posts.

Simply head over to Pages » All Pages from the left sidebar. On the next page, you need to hover your mouse cursor over the title of a page that you want enable or disable comments and click the Edit link.

WordPress Page edit option

On the top-right corner of your page, you’ll see the 3 vertical dots icon. You need to click on it to open a dropdown menu and then click on Options.

This will open a popup box, and you need to make sure the Discussion box is enabled here.

Page document options

Once you close this modal box, you’ll see the Discussion meta box on the right side of your editor. If you don’t see it, then please make sure that you click on the Document tab to view it.

Discussion meta box

Now, you can uncheck the Allow Comments box to disable comments on this page and click on Update to save the changes.

On the other hand, if you want to selectively enable comments, then you can just check the box to enable it for certain pages.

You can follow the same process for turning off comments on individual posts or other custom post types.

Disable Comments on Pages and Posts in Bulk

Want to disable comments on all your published posts and pages without doing it individually? You can do that without the use of a plugin.

First of all, go to Posts » All Posts to see all your articles.

Next, select all the posts, choose Edit from the Bulk Actions dropdown box, and click on Apply.

Edit Posts in bulk

You’ll now be able to perform bulk actions including changing the author name and turning off comments for all the selected posts.

Select Do not allow from the comments dropdown box and click on Update. This will disable comments on all your selected posts.

Disable comments on posts in bulk

You can follow the same process to turn off comments on your pages.

Delete All WordPress Comments

While the above methods will disable comments on your posts and pages, it will not remove the existing comments from your WordPress site.

To delete all the comments from your site, click on Comments from the left sidebar of your admin panel.

Delete all WordPress comments

Next select all the comments, choose Move to Trash option from the Bulk Actions dropdown box, and click on Apply. This will delete all the existing comments from your site.

If your website has a lot of comments, then you will have to repeat this step multiple times.

Disable Comments on Media

If you are looking to disable comments on media pages, then there are two ways to go about it.

You can either manually disable comments on individual media attachment files by following the methods we discussed above but that can be really time consuming.

The easier way to bulk disable comments on all media attachments is by using a code snippet. Simply paste the following code in your theme’s functions.php file or a site-specific plugin.

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

In case you’re not comfortable with the above solution, you can check out the next section where we’ll show you how to use a plugin to disable comments on Media attachments.

Disable WordPress Comments the Easy Way Using a Plugin

If you don’t want to disable comments manually, then you can use the Disable Comments plugin to do it with just a click.

It allows you to completely disable comments everywhere on your WordPress site. You can also disable them on specific post types like posts, pages, media, and others. It also removes the comment form and stops displaying existing comments.

Disable Comments Plugin

First thing you need to do is install and activate the Disable Comments plugin. You can follow our step by step guide on how to install a WordPress plugin for detailed instructions.

After activating the plugin, head over to Settings » Disable Comments from the left sidebar of your admin panel.

Selecting the first option allows you to disable comments on your WordPress site. The plugin will also remove the comments menu item from your WordPress admin area.

Disable Comments Plugin Settings

Using the second option, you can selectively disable comments on your posts, pages, or media.

If you want to remove comments only from the media attachments, then you can select On certain post types radio button and then check the Media checkbox.

You can do the same if you only want to turn off comments on WordPress pages. Using the plugin is the easiest way to disable comments on WordPress pages.

When you’re done, simply click on the Save Changes to complete the process.

Remove “Comments Are Closed” in WordPress

If your WordPress theme is not checking the comment status properly, then it may still display the comment form, existing comments, or even show the “Comments are closed” message.

You can ask your theme developer to fix this because this is not a standard compliant approach.

Alternatively, you can also try fixing it yourself by following the instructions below.

First, connect to your WordPress site using FTP Client or the File Manager in your WordPress hosting control panel. Now navigate to your current theme folder which will be located in /wp-content/themes/ folder.

In your theme folder, you need to locate the file comments.php, right-click on that file, and rename it to comments_old.php.

Rename comments php file

Next, you need to right-click in the right panel of your FTP client and select Create new file option. And then, name your new file as comments.php and click the OK button.

Create a new comments file

This trick simply serves an empty comments template to your WordPress theme, so no comments or comment related messages will be shown.

If your WordPress theme does not have the comments.php file, then you need to ask your theme developer which file you need to edit.

Spam Protection Techniques

If you’re planning to disable WordPress comments just for the sake of protecting your site from spammers and link builders, then we would rather recommend you to use some of the following techniques to combat spam.

Akismet

Akismet WordPress Plugin

Akismet is one of the best plugins for dealing with spam comments. And the best part is it has been built by the team behind WordPress.

This plugin checks each comment on your site and verifies whether it’s spam or not. For more details, you can check out our guide on the Akismet plugin.

Closing Comments

Did you know that you can close comments after a certain period of time?

Close comments after a specific period

Head over to Settings » Discussion and check the field that says “Automatically close comments on articles older than 14 days”.

This will close the comments form after 14 days automatically. You can also change the number of days based on your needs.

Typically spammers target older posts, so several users change this setting to 180 days which significantly reduces spam.

Honeypot with Antispam Bee

On WPBeginner, we have found it helpful to add a second plugin called Antispam Bee which works alongside with Akismet to significantly reduce comment spam on your site.

It adds an invisible honeypot that blocks 99% of spam bot comments.

Comment Captcha

Though adding a captcha to your comment form is not user-friendly, it still helps you to protect your site from spammers.

You can use the Advanced noCaptcha and Invisible Captcha plugin to add Google reCaptcha just before the submit button of your comment form.

Remove Website URL Form Field

Another way to deal with link builders and spammers is to remove the website URL field from the comment form. Here’s an example from the WPForms website:

Remove Website URL field from comment form

And you can use the Comment Link Remove and Comments Tool plugin for this purpose. It allows you to remove the website URL field from your comment form without touching a single line of code. Isn’t that great?

Blocking Bad IPs

You can also block bad IP addresses from accessing your WordPress site. This will help you to block spammers and hacking attacks.

To do that, you can check our guide on how to block IP addresses in WordPress.

Anyways, we hope this detailed guide helped you to understand how to completely disable comments in WordPress with and without using a plugin.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Completely Disable Comments in WordPress (Ultimate Guide) appeared first on WPBeginner.



Source link

How to Paginate Comments in WordPress (Step by Step)


Have you noticed that your blog posts with a lot of comments load slower than other posts? That’s because loading so many comments increase server load which increases your average page load time.

Having a lot of comments is a good thing because it means that your users are engaged with your content. Your most commented posts are usually the most popular posts on your blog.

However if a lot of comments are slowing down your website, then it can hurt your SEO rankings. That’s when pagination for WordPress comments comes handy.

In this article, we will show you how to paginate comments in WordPress to speed up your post load time. The best part is that it comes as a default feature in WordPress, and it is very easy.

Paginate comments in WordPress

Why You Should Paginate Comments in WordPress

Comment pagination helps you improve your website speed which is an important factor in your website SEO rankings.

Many of our users have reported that sometimes posts with a lot of comments can cause their readers to see white screen of death because it exhausts their server’s memory.

Even when it doesn’t cause ‘white screen of death’, posts with a lot of comments tend to be really really slow.

Comment pagination reduces server load for your most commented posts by splitting comments into multiple pages.

Another reason to paginate your WordPress comments is to maintain the keyword density of your articles. Comments add a lot of content to your post’s page, and they may not always include your target keywords in a sufficient amount.

When keyword ratio to content decreases, search engines fail to index your post for the right keywords.

Comment pagination can also have a negative SEO impact if it is not used correctly. Basically, WordPress generates URLs for each new page of comments. Search engines may consider this as ‘duplicate content’.

This issue can be easily fixed by using the Yoast SEO plugin, which points search engines to the canonical URL of your article.

Now that we have discussed the pros and cons of comment pagination, let’s take a look at how to easily paginate comments in WordPress.

Paginating WordPress Comments in Two Steps

The first thing you need to do is login to your WordPress admin area and go to Settings » Discussions page.

Next, look for the ‘Break comments into pages’ option. From here you need to enter the number of comments you want on each page, and how you want to display them.

Break Comments into Pages in WordPress Posts

Don’t forget to click on the ‘Save Changes’ button to store your settings.

You can now visit any popular post on your website that has a lot of comments. You will notice the pagination links below the comments.

Depending on your theme’s styling, you will either see numeric pagination or ‘Previous / Next’ comment links.

Here is how comment pagination looks on our article 24 “Must Have” WordPress Plugins.

WordPress Comments Pagination in WPBeginner

Note: Just like comments, you can also paginate WordPress posts by splitting a long post into multiple pages.

We hope that this tutorial helped you paginate comments in WordPress. You might also want to see our guide on how to combat comment spam in WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.



Source link