Writing a WordPress blog

Managing Comments and Comment Spam on a WordPress Blog

Comments can make a blog feel alive. A good question under a post often leads to a better answer than the post itself. The trouble is that open comment forms also attract spam. Left alone, a busy blog can collect hundreds of junk comments full of links.

The good news is that WordPress already gives you most of the tools you need. They sit in two places in the dashboard. One is the Discussion Settings screen and the other is the Comments screen. Set them up once and the daily work becomes a quick check rather than a chore.

Start with the Discussion Settings screen

You will find this screen under Settings and then Discussion. The official WordPress Discussion Settings documentation explains each option in detail. The first group covers default settings for new posts. These defaults can be changed on any single post, so you are not locked in. A sensible approach is to set the defaults for the blog as a whole and adjust the odd post by hand.

One default lets people post comments on new articles. Untick it and new posts will not accept comments at all. Another allows link notifications from other blogs, known as pingbacks and trackbacks. When that box is ticked, these notices appear in your comments section. Many site owners find they add little and switch them off.

Decide who is allowed to comment

The next group of settings controls who can leave a comment. You can require the comment author to fill out a name and email address. WordPress does not check that the address is real, so this only adds a small hurdle. The stronger option is to require people to be registered and logged in before they comment.

Requiring registration suits a members area or a private community. It is less helpful on an open business blog, because most readers will not create an account just to ask a question. If you do open registration, think about what each user can do on the site. Our guide on creating a new role in WordPress covers how user roles and their abilities work.

Close comments on older posts

Spam tends to pile up on old posts that nobody is watching. WordPress lets you close comments automatically on articles older than a set number of days. After that point the comment form is disabled for the post. Comments that were already approved stay visible, so older discussions are not lost.

The right number of days depends on how your blog is used. A news style blog might close comments after a few weeks. A blog of long running guides might leave them open much longer. You can always reopen comments on a single post if a reader has a good reason to ask something.

Hold comments for approval

The section headed Before a comment appears is where most of the spam control happens. The first option says an administrator must always approve the comment. With it switched on, every comment waits for a person with the right role to approve it. Nothing goes live on its own.

The second option is a little gentler. It says the comment author must have a previously approved comment. If the email address matches an earlier approved comment, the new one is posted straight away. If not, it is held for moderation, so regular readers are not kept waiting.

Use the moderation and blocklist rules

Comment spam often carries a large number of links. WordPress lets you hold a comment in the queue once it contains a set number of links. Setting this low means link heavy comments wait for review rather than appearing on the page. This matters for your site’s reputation as well as its look.

Spam links in your comments are links from your page to sites you have never checked. If you want to know why poor quality links can cause trouble, see our post on backlinks that can lead to Google ranking penalties. Keeping junk links off your own pages is simply good housekeeping. It also keeps the conversation useful for real readers.

Below the link setting is a word list for moderation. Any comment containing a listed word in its content, name, URL, email, IP address or browser user agent string is held in the queue. You add one word or IP address per line. Matching happens inside words too, so the documentation warns that “press” will match “WordPress”.

The Comment Blocklist works in a similar way but is much harsher. WordPress renamed this setting in version 5.5, so older guides may call it the Comment Blacklist. Matching comments are treated as spam rather than held for review. The documentation describes it as a last resort, because genuine comments can be caught as well.

Work through the Comments screen

Once your settings are in place, the daily work happens on the Comments screen. The WordPress Comments screen documentation describes the filters across the top. They let you view All, Pending, Approved, Spam or Trash comments. Checking the Pending list is usually the first job of the day.

Hover over any comment to see the actions you can take. You can approve or unapprove it, reply to it or edit it. Quick Edit lets you change the name, email, URL or comment text in place. You can also mark the comment as spam or send it to the trash.

For larger clean ups, tick a group of comments and use the Bulk Actions menu. The options are Unapprove, Approve, Mark as Spam and Move to Trash. Inside the Spam view, an Empty Spam button deletes every spam comment at once. The Trash view has a matching Empty Trash button, and any trashed comment can be restored before then.

A simple weekly routine

A short routine keeps comments under control without taking over your week. Most of it takes only a few minutes once your settings are right. Here is a pattern that suits many small business blogs:

  • Check the Pending list and approve real comments promptly
  • Reply to genuine questions so readers know someone is listening
  • Mark obvious junk as spam rather than simply trashing it
  • Look over the Spam list before emptying it, in case a real comment slipped in
  • Add repeat spam words to the moderation list

Plugins can add extra spam filtering if your blog is very busy. Each extra plugin is more code to keep updated, so add only what you need. Our post on disabling plugin updates in WordPress explains how plugin updates are handled. Weigh that upkeep before adding another tool.

Set it up early on a new blog

The easiest time to sort out comments is before the blog goes live. Decide if you want comments at all and who should moderate them. Then set your Discussion Settings before the first post is published. It is one of several small jobs in our tips for creating a new WordPress website.

You can also choose when WordPress emails you about comments. Under Email me whenever, WordPress can email you each time anyone posts a comment. It can also email you when a comment is held for moderation. On a busy post the first option can fill an inbox quickly, so many owners keep only the second.

Frequently asked questions

Can I turn off comments on just one post?

Yes. The Discussion Settings are defaults and can be changed on individual posts. This lets you keep comments open on most posts and close them on a few.

What happens to old comments when I close comments on a post?

Comments that were already approved stay visible. Only the comment form is disabled. Readers can still read the earlier discussion.

Should I trash spam or mark it as spam?

Marking it as spam keeps it in the Spam list, where you can review it before it is deleted. Trash is better suited to real comments you simply do not want to keep. Either can be emptied with one button.

Why is a real comment stuck in moderation?

It may contain a word from your moderation list, even inside a longer word. It may also have more links than your set limit. Check both settings if this keeps happening.