Short answer: To stop WordPress comment spam, work in layers. In Settings, then Discussion, hold comments with two or more links, require that a commenter has a previously approved comment, and close comments on posts older than a set number of days. Add common spam terms to the moderation list rather than the disallowed list, because WordPress deletes disallowed matches immediately without telling you. Install one anti-spam filter plugin to catch what settings miss. If bots hammer wp-comments-post.php, add a rate limit at your firewall or CDN. If you do not want comments at all, turn them off for new posts and close them on old ones.
Why comment spam is a security problem, not just clutter
Spam comments mostly exist to plant links. Approved spam links make your pages look neglected to readers and can point visitors to scams, malware or adult sites. A comments section full of junk also wastes your time, buries real feedback and can drag down how search engines judge the page. On busy sites, bots posting thousands of comments add measurable load to the server and the database.

The goal is not zero spam attempts, which is impossible on a public site. The goal is that spam never appears publicly and costs you almost no time.
Layer 1: Discussion settings
Go to Settings, then Discussion. WordPress’s documentation describes each option; these are the ones that matter most for spam.
| Setting | Recommended value | Why |
|---|---|---|
| Comment author must have a previously approved comment | On | New commenters go to moderation; regulars post instantly |
| Hold a comment if it contains X or more links | 1 or 2 | Spam usually carries several links |
| Comment author must fill out name and email | On | Stops the laziest bots, though values are not verified |
| Automatically close comments on articles older than X days | 30 to 90 | Old posts attract most spam and few real comments |
| Allow link notifications from other blogs | Off | Pingbacks and trackbacks are a common spam channel |
| Email me when a comment is held for moderation | Your choice | Useful on small sites, noisy on large ones |
The previously approved comment rule is the single most effective setting. WordPress matches it by email address, so once you approve a genuine reader, they can comment freely, while every first-time comment waits for you. Closing old posts is the next biggest win: spam bots target old, well-indexed URLs, and auto-close keeps existing approved comments visible while removing the form.
Layer 2: Moderation and disallowed keys
WordPress has two keyword lists, and the difference matters. The moderation list holds any comment that contains a listed word, IP address or pattern, one entry per line. The disallowed list, called Disallowed Comment Keys and previously known as the blacklist, works the same way, but WordPress’s documentation warns that matching comments are deleted without notification, so genuine comments could vanish without you ever knowing.
Put most terms on the moderation list. Reserve the disallowed list for patterns you are certain never appear in real comments, such as specific spam domains. Remember that entries match partial words: WordPress’s documentation gives the example that press would match WordPress. Short entries cause false positives, so prefer full words and domains. After adding moderation keys, use the option to check past comments against the list to test them.
Layer 3: An anti-spam filter
Settings and keyword lists cannot recognize new spam patterns. A dedicated anti-spam plugin compares comments against known spam or uses hidden form fields that bots fill in but humans do not see. Choose one well-maintained option and run only that one; stacking several can block legitimate comments and complicate troubleshooting. Check how the plugin handles personal data, since some send comment content to an external service for analysis, and mention that in your privacy policy.
CAPTCHA challenges also reduce spam but add friction and accessibility problems for real readers. Try the previous layers first and add a challenge only if spam still gets through.

Layer 4: Stop bots before WordPress loads
On sites hit by heavy automated spam, the cost is not only the comments but the server work of processing each submission. Comments are submitted to wp-comments-post.php. A firewall or CDN rule can limit how many requests a single IP may send to that file per minute, and can challenge or block requests with no referrer from your own site, which many bots skip. If you use Cloudflare, a rate limiting rule for that path is a natural fit; our guide to Cloudflare security settings for WordPress shows how to spend free-plan rules wisely.
Test any server rule by posting a real comment afterwards. It is easy to block your own readers by accident, particularly those on mobile networks that share IP addresses.
If you do not need comments at all
Many business and documentation sites receive no useful comments. In that case, untick Allow people to submit comments on new posts in Discussion settings, and close comments on existing posts using bulk edit on the Posts screen or the auto-close setting. Some themes still show a comment form after that; if so, check theme options. Turning comments off removes the spam problem entirely and shrinks your attack surface.
Clean up spam that already got through
Open Comments and filter by Pending and Spam. Empty the spam folder regularly. For approved spam, search comments for common spam words or link patterns and mark them as spam in bulk, which also helps anti-spam filters learn. If you find comments containing script tags or strange encoded text, treat it as a possible security incident rather than spam, and check for injected content elsewhere; our guide to signs a WordPress site has been hacked lists the quick tests.
Comment spam and login attacks often come from the same bot networks. If you see a spike in one, check the other; our guide to stopping WordPress brute force attacks covers confirming and blocking them at the server.
A low-maintenance routine
Once the layers are in place, comment management should take a few minutes a week: approve genuine first-time commenters, mark the odd spam that slips through, and empty the spam folder. Review your moderation list every few months and remove entries that cause false positives. Keep WordPress, your theme and the anti-spam plugin updated.
Frequently asked questions
What is the difference between moderation keys and disallowed keys?
Moderation keys hold matching comments for review. Disallowed keys delete matching comments immediately without notifying you, so real comments can be lost. Use moderation keys for most terms.
Will closing comments on old posts hide existing comments?
No. Auto-close disables the form on older posts, but approved comments stay visible.
Should I turn off pingbacks and trackbacks?
On most sites, yes. They are a common spam channel and rarely add value today.
Do I need a CAPTCHA?
Usually not at first. Discussion settings, an anti-spam filter and auto-close stop most spam. Add a challenge only if spam still gets through.



