WordPress

How to Block WordPress Spam Comments and Email Notifications

If your WordPress website is being bombarded by spam comments or form submissions, we understand how frustrating and overwhelming that can be. Fortunately, there are several steps you can take to reduce or eliminate spam effectively, helping you regain control over your site and keep your focus on what matters most. Follow these tips to get started.

1. Disable Comments Entirely (Recommended if You Don’t Need Them)

If your site doesn’t need a comment section — such as for a brochure site, landing page, or online store — disable comments completely:

  1. Go to Settings → Discussion
  2. Uncheck “Allow people to post comments on new articles”
  3. Use the Disable Comments plugin to remove comment functionality site-wide

To disable comments on existing content:

  • Use Quick Edit to turn off comments for individual posts
  • Use the Bulk Actions menu from Posts → All Posts to apply this across multiple entries

This is the simplest and most effective way to shut down spam entirely.

2. Activate a Spam Filter Plugin

If you need comments, install a trusted anti-spam plugin:

These tools catch spam automatically before it reaches your moderation queue.

3. Harden Your Comment Settings

Go to:
WordPress Dashboard → Settings → Discussion

Recommended settings:

  • Enable “Comment author must have a previously approved comment”
  • Disable “Anyone can post a comment”
  • Enable “Comment must be manually approved”
  • Enable “Users must be registered and logged in to comment” (optional but highly effective)
  • Use the Disallowed Comment Keys field to block common spam keywords like casino, viagra, or shortened URLs like is.gd

To populate this list with known spam terms:

4. Automatically Close Comments on Older Posts

Still in Settings → Discussion:

  • Enable “Automatically close comments on articles older than”
  • Set to 14 days or another suitable duration

This reduces comment spam on outdated or archived content.

5. Require CAPTCHA for Comment Submission

CAPTCHA helps block automated spam:

You can also consider all-in-one plugins that add comment protection:

6. Remove Existing Spam Comments

To clean up spam already in your database:

  • Go to Comments → Spam and click “Empty Spam”
  • Go to Comments → Pending and click “Trash All”
  • For large volumes or automation, use WP Bulk Delete

7. Filter Spam Emails with Ecenica Mail

If you’re receiving spam through comment notifications or contact forms, Ecenica‘s built-in mail filtering tools can help block them before they reach your inbox.

a) Enable Spam Filters in cPanel

  1. Log in to Ecenica Dashboard.
  2. Navigate to your plan and click Login to cPanel.
  3. Go to Email → Spam Filters.
  4. Enable SpamAssassin (on by default).
  5. Set a spam threshold score — the default of 5 is recommended for balance, but you can lower it to 4 for stricter filtering.
  6. Enable Auto-Delete Spam or move spam to the Junk folder to keep your inbox clean.

b) Create Email Filters

  1. In cPanel, go to Email → Email Filters.
  2. Create custom rules to filter incoming mail based on:
    • Subject line keywords (e.g., “casino”, “loan”, “viagra”)
    • From address patterns (e.g., unknown domains or fake addresses)
    • Body content (e.g., common spam phrases)

This is especially helpful for filtering spam from WordPress contact forms or comments that generate email notifications.

Note: If you’re not hosting your email with Ecenica, reach out to your email provider for guidance on configuring their spam filters. Most providers offer tools or rules to block unwanted messages, especially those generated by WordPress comment notifications or form submissions.

Was this guide helpful?

Need help with this?

Open a ticket and link to this guide so our team can see what you have tried.

View support tickets

Power your business with Ecenica Hosting

Built for WordPress and serious websites. Fast, secure and supported by real people in the UK.

Ecenica hosting services represented by a connected red route across London