banner



How To Delete A Comment On A Wordpress Blog

The WordPress comments system can be a valuable feature. Letting visitors leave comments on your posts can increase engagement and provide various other benefits. At the same time, this isn't functionality you'll need or want on every website.

Fortunately, if you aren't using them, it is possible to disable WordPress comments. Aside from removing an unneeded feature, this can be a smart way to reduce spam and speed up your WordPress website.

In this post, we'll talk more about why you might want to disable comments in WordPress. Then, we'll walk you through three quick and easy ways to do so.

Prefer to watch the video version?

Why You Might Choose to Disable WordPress Comments

It's easy to forget these days, but WordPress began life as a blogging platform. Although it's grown a lot since then, many of its core features still focus on functionality that's useful on blogs and similar types of websites such as a fairly robust comments feature:

WordPress Disable Comments
Example of a comment on a WordPress site

WordPress enables you to let visitors leave comments on your site's content. By default, this feature is disabled for pages and enabled for posts. This makes sense, as it's rare you'd want to permit comments on static web pages.

On the other hand, comments sections can really enhance your blog posts, news articles, and other timely content.

Still, not every website needs or will benefit from comments sections. In fact, sometimes it's best to disable WordPress comments altogether. Some of the situations in which this makes sense include:

  • When you don't have a blog, or you use the 'posts' content type to create a different type of content (such as product pages).
  • Your site is largely devoted to providing information via static pages, rather than generating conversations.
  • You're running a business website and you're concerned that comments may make your pages appear less professional.
  • You'd like to encourage your audience to communicate somewhere other than on your posts and pages, such as in a dedicated forum.

No matter what type of site you run, there are a few other potential benefits to turning off comments in WordPress.

For example, you won't have to worry about spam comments making your site look messy, or filling up your posts with spammy links. In addition, disabling comments means your pages will be leaner, which can have a positive effect on your site's performance.

Every site is different, so you'll need to weigh up the pros and cons of comments for your particular niche and audience. If you decide you'd like to disable comments, either partly or entirely, there are a number of easy ways to make it happen.

How to Disable Comments in WordPress (3 Methods)

There are quite a few ways to disable comments in WordPress. The three main options are to use WordPress' built-in settings, a plugin, and some custom code.

Each approach has its advantages and is more useful in specific scenarios. You can read through all three or use the links below to jump to the section you're most interested in.

1. Disable Comments Using WordPress' Built-In Options

The first and simplest way to disable WordPress comments is to use the settings that are already included within the platform. This is a quick fix, although there are certain limitations involved (which we'll discuss in a moment).

If you just want to turn off comments entirely, however, this is usually the best way.

There are two approaches you can take, depending on whether you want to disable comments in WordPress for a specific post or page, or throughout your whole website.

Option 1: Turn Off Comments on a Specific Post or Page

First, let's look at how to turn off comments on one particular post or page.

However, remember that comments are disabled by default for pages, so you'll only need to turn them off on individual pages if they were enabled at some point.

To get started, open up the WordPress post or page in question. Then, check out the right-hand sidebar. You should see a section labeled Discussion: go ahead and open it up:

Disabling comments on a WordPress post
Disabling comments on a WordPress post

Here, you'll find two options. To disable comments, simply uncheck the Allow Comments box. Then, make sure to save or update the page or post, and visitors will no longer be able to leave comments on it.

For reference, here's how it all looks for those using the Classic Editor:

classic editor discussion 1
The Discussion settings and Allow comments checkbox in the Classic Editor

However, keep in mind that this won't remove pre-existing comments on the page or post.

To do this, you'll need to delete them manually under the Comments tab of your WordPress dashboard.

Option 2: Turn Off Comments Globally

On the other hand, what if you've decided you don't want to permit comments on any of your site's posts? In this scenario, you'll also want to disable comments in WordPress globally.

You can do this by navigating to Settings > Discussion:

WordPress' Discussion settings
WordPress' Discussion settings

Here, simply uncheck the Allow people to post comments on new articles option. This means all future posts created on your site will have comments disabled.

There are two drawbacks to this particular method. First, much like the option above, it doesn't remove any existing comments from your site (you'll still need to manually delete them).

In addition, this won't disable comments on your existing posts either, only on new ones. Fortunately, there's a little trick you can use to handle this content too. On the same page, locate the Automatically close comments on articles older than _ days option, check the box, and add 0 to the field.

This will close all of the comments sections on your site's current posts. When combined with the previous setting, this has the effect of disabling your comments sections globally.

Want to know how we increased our traffic over 1000%?

Join 20,000+ others who get our weekly newsletter with insider WordPress tips!

Subscribe Now

2. Disable Comments Using a WordPress Plugin

The settings we looked at above are easy to access and will let you disable comments on your WordPress site. However, they don't provide you with a lot of control over the process. Plus, you'll likely have some tedious cleanup to do afterward.

If you want to fine-tune the way comments work on your site, or are simply looking for a faster and more elegant solution, you may want to consider picking up a dedicated plugin.

There are a few tools to help you turn off WordPress comments. Let's look at two of them.

Option 1: Install a Free Plugin

If your budget is limited, or you want a very simple solution, you can check out the free plugin Disable Comments:

disable comments plugin 1
The Disable Comments WordPress plugin

This plugin enables administrators to globally disable comments, or disable them for specific post types only. Disable Comments has over 1 million active installs and a 4.9 out of 5-star rating, so it comes well recommended. Plus, it's easy to use.

After installing the plugin, you'll find its new options under Settings > Disable Comments:

disable comments plugin settings 1
Disable Comments plugin settings

As you can see, your options are pretty straightforward. You can disable comments everywhere on your site with one click.

Alternately, you can turn them off for posts, pages, or custom post types. This lets you disable WordPress comments on pictures and other media files, as well as on WooCommerce products.

Finally, just hit the Save Changes button. Keep in mind that these settings can't be overridden by enabling comments via the regular WordPress Discussion settings or on individual posts and pages.

This a useful solution if you have multiple users on your site and want to prevent anyone else from re-enabling the comments feature.

Option 2: Pick Up a Premium Solution

Of course, the above plugin isn't your only option for dealing with your WordPress site's comments sections. You can also consider purchasing a premium plugin. One solution is to pick up the perfmatters plugin, which is developed by a team member here at Kinsta:

perftmatters plugin 1
The perfmatters WordPress plugin

This plugin is designed to improve your WordPress site's performance and offers a suite of features such as a streamlined dashboard and various behind-the-scenes tweaks that minimize potential slowdowns and bloat.

In addition, perfmatters includes a very simple option for turning off comments in WordPress. You'll find it in the plugin's settings under the Options tab (the setting is labeled Disable Comments). By toggling this option, you can enable or disable comments globally, without the need to worry about any additional settings.

This does offer less fine-grained control over your comments settings than the previous plugin. However, if you simply want to turn off your WordPress comments, and you're also looking to speed up your website, this tool can handle both tasks for you effortlessly.

3. Disable Comments via Custom Code

If neither of the above options offers enough control, or you want more options but would like to avoid adding another plugin to your site, you can use custom code instead.

What you can accomplish via this method will naturally depend on your technical skill and experience, but simply disabling your site's comments section is pretty simple.

You can remove the comments section from appearing within your WordPress theme altogether using some basic HTML commands. Please note that editing the source code of your WordPress theme is risky, and could break your site if not done correctly.

On top of that, best practices suggest creating a child theme when performing such activities. If you aren't comfortable doing this yourself, you may want to source the work out to a WordPress developer.

If you're interested in trying this technique yourself, make sure to first test it on a staging environment and always back up your production website before pushing changes live.

Now, open your page.php file in your favorite HTML editor, look for the following line of code:

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

Go ahead and replace it with this line of code instead:

          <!-- Begin Comment <?php comments_template( '', true ); ?> End Comment -->        

This will turn off the comments section on all of your site's pages, both removing existing comments and preventing new ones.

To do the same with your site's posts, navigate to your single.php file and find the following code:

          <?php comments_template(); ?>        

Then, replace it with this code:

          <!-- Begin Comment <?php comments_template(); ?> End Comment -->        

With that, you'll have disabled WordPress comments on both your posts and pages.

Keep in mind that you'll need to repeat this process for additional post types if needed.

Are you taking advantage of comments on your site? If not, then why keeping them at all as they could open the door to spammers and slow down your site? Check out how to disable them! 🗣🦥 Click to Tweet

Summary

Sometimes, you'll want to encourage your website's visitors to ask questions and start discussions with one another. However, if you want to prevent spammy content or would like to improve performance, you might want to disable WordPress comments instead.

There are three main ways to do this. You can disable comments on WordPress using:

  1. WordPress' built-in options.
  2. A WordPress plugin, such as Disable Comments or perfmatters.
  3. Custom code.

Now, it's your turn: are you keeping comments enabled on your site? Yes, no? Share your experience in the comments section!


Save time, costs and maximize site performance with:

  • Instant help from WordPress hosting experts, 24/7.
  • Cloudflare Enterprise integration.
  • Global audience reach with 29 data centers worldwide.
  • Optimization with our built-in Application Performance Monitoring.

All of that and much more, in one plan with no long-term contracts, assisted migrations, and a 30-day-money-back-guarantee. Check out our plans or talk to sales to find the plan that's right for you.

How To Delete A Comment On A Wordpress Blog

Source: https://kinsta.com/blog/wordpress-disable-comments/

Posted by: davisalowely.blogspot.com

0 Response to "How To Delete A Comment On A Wordpress Blog"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel