By Connect Digital World | WordPress Made Easy
Imagine you open the front door of your shop in the morning, and there are strangers inside sticking posters on your walls. Nobody invited them, and the posters are for things you would never sell.
That is what WordPress spam feels like. Fake comments, fake users and strange posts show up on your website, and they can hurt your Google ranking and your visitors’ trust. The good news is that you can fix it. In this guide, you will learn how to stop WordPress spam posts and secure your website, step by step, in simple words.
Quick Checklist: 12 Ways to Stop WordPress Spam
- Understand what kind of spam you have.
- Turn off open user registration (if you do not need it).
- Set comment rules in WordPress.
- Use an anti-spam plugin such as Akismet.
- Add a bot check to your forms.
- Protect your login page.
- Use strong passwords and two-step login.
- Keep WordPress, plugins and themes updated.
- Delete things you do not use.
- Add a firewall.
- Back up your site every day.
- Clean up if you were already hacked.
What Is WordPress Spam? (Simple Explanation)
Spam means unwanted messages or content that robots, called bots, send out by the thousands. Bots are small programs that visit websites automatically, like a swarm of tiny mail carriers who deliver junk mail everywhere.
Not every spam problem is the same. On a WordPress site, you may see one or more of these:
- Spam comments: Messages under your posts, usually with links to shady sites.
- Contact form spam: Junk messages sent through your contact page.
- Fake user registrations: Bots that sign up for accounts on your site.
- Spam posts and pages: Strange posts that you never wrote, often about pills, gambling or odd products.
- Hidden spam links: Secret links added to your pages that you cannot see, but Google can.
The first three are annoying. The last two are serious, because they usually mean someone got into your site. We will cover both.
Why Does Spam Matter? It Is More Than Annoying
- It hurts your Google ranking. Spam links can make your site look untrustworthy.
- It slows your website. Thousands of fake comments and users fill up your database.
- It scares visitors. Nobody wants to read a blog full of junk.
- It can be a security warning. Every fake account is a possible way in for a bad guy.
- It wastes your time. Cleaning spam by hand takes hours.
Step 1: Find Out Where the Spam Is Coming From
Before fixing anything, check where the spam appears. Look at these places in your WordPress dashboard:
- Comments: Are there junk comments waiting for approval?
- Users: Do you see many accounts with strange names and emails you do not know?
- Posts and Pages: Do you see posts you did not write?
- Your form plugin: Are there many weird form submissions?
Also check for admin users you do not recognise. Go to Users → All Users and filter by the Administrator role. If you see an admin you did not create, treat it as an emergency and jump to Step 12.
Step 2: Turn Off Open Registration
If your site does not need visitors to create accounts, this is the easiest win. A normal blog usually does not need it.
- Go to Settings → General.
- Find Membership.
- Untick “Anyone can register”.
- Click Save Changes.
If you do need registration (for a shop or a members area), set New User Default Role to Subscriber. Never leave it set to Editor or Administrator. Also consider email confirmation or admin approval for new users, using a trusted plugin.
Then clean up. Delete the fake users, but be careful not to delete real members or your own admin account.
Step 3: Set Smart Comment Rules
WordPress has built-in tools to slow down comment spam. Go to Settings → Discussion and try these:
- Comment must be manually approved: Nothing appears until you say so.
- Comment author must have a previously approved comment: Trusted people can comment freely.
- Hold a comment in the queue if it contains 1 or more links: Most spam contains links.
- Automatically close comments on posts older than 30 days: Bots love old posts that nobody watches.
- Disallowed comment keys: Add words like gambling, casino or pills, and comments with those words will be blocked.
If you do not need comments at all, you can switch them off for all new posts by unticking “Allow people to submit comments on new posts”.
Step 4: Use an Anti-Spam Plugin
An anti-spam plugin works like a security guard at the door. It checks each message and throws away the junk before you ever see it.
- Akismet Anti-Spam: A well-known plugin made by the WordPress team at Automattic. It is free for personal blogs, and paid plans are available for commercial sites.
- Antispam Bee: A free option that many people use for comments.
- Your security plugin: Some all-in-one security plugins also block spam registrations.
Pick one anti-spam plugin and set it up properly. Using five at once can slow your site and cause problems.
Step 5: Add a Bot Check to Your Forms
Contact forms, comment boxes and registration pages all need a way to tell humans from bots. There are several options:
- CAPTCHA tools: Google reCAPTCHA, hCaptcha or Cloudflare Turnstile ask visitors to prove they are human, often without a puzzle.
- Honeypot fields: A secret hidden box that people cannot see but bots fill in. If it is filled, the form is rejected.
- Email verification: The new user must click a link sent to a real email address.
One thing to know: no single check stops every bot. Clever bots can sometimes pass a basic CAPTCHA. That is why smart site owners use layers, which means several protections working together, like a castle with a wall, a moat and a gate.
Step 6: Protect Your Login Page
Bots often try thousands of passwords on /wp-login.php. This is called a brute force attack. Here is how to defend against it:
- Limit login attempts. After a few wrong tries, the visitor is locked out for a while.
- Use two-factor authentication (2FA). Even if someone steals your password, they also need a code from your phone.
- Do not use “admin” as your username. Pick something harder to guess.
- Use a unique, long password. A password manager helps.
Step 7: Harden Your Website With a Few Lines of Code
These small changes make your website harder to attack. Always make a backup first, and be very careful when editing files.
Stop People Editing Files From the Dashboard
If a hacker gets into your admin area, the built-in file editor lets them change your theme and plugin code. You can turn it off. Open wp-config.php and add this line above the text that says “That’s all, stop editing!”:
define( 'DISALLOW_FILE_EDIT', true );
Force Secure Logins
If your site has an SSL certificate (https), make sure the admin area always uses it:
define( 'FORCE_SSL_ADMIN', true );
Protect wp-config.php
This file holds important secrets. On an Apache server, add this to your .htaccess file to block outside access:
<Files wp-config.php>
Require all denied
</Files>
Turn Off XML-RPC (If You Do Not Use It)
XML-RPC is an old feature that bots sometimes abuse to guess passwords. If you do not use apps or tools that need it, you can switch it off by adding this to your theme’s functions.php file or a small code snippets plugin:
add_filter( 'xmlrpc_enabled', '__return_false' );
Some services, such as Jetpack, may need XML-RPC, so check before turning it off.
Block Directory Browsing
This stops people from viewing the list of files in your folders:
Options -Indexes
Safety tip: If you are not comfortable editing code, use a trusted security plugin instead or ask your hosting support to help.
Step 8: Keep Everything Updated
This is the most important security rule of all. Old software has known holes, and bots look for them every single day.
- Update WordPress core when new versions come out.
- Update your plugins and themes.
- Use a recent version of PHP (your host can help).
- Turn on automatic updates for plugins you trust.
Even popular security and anti-spam plugins sometimes have bugs that get fixed later. That does not mean you should avoid them. It means you should update them quickly.
Step 9: Delete What You Do Not Use
Every plugin and theme is another door into your site. If you are not using it, remove it.
- Delete inactive plugins and themes (not just deactivate them).
- Avoid “nulled” or pirated plugins and themes. They often contain hidden malware.
- Only download from the official WordPress directory or trusted companies.
- Check that a plugin is still being updated before you install it.
Step 10: Add a Firewall
A web application firewall (WAF) is like a bouncer standing outside your website. It stops bad visitors before they get close. You have two main choices:
- A cloud firewall such as Cloudflare, which filters traffic before it reaches your server. This is the best place to stop bots early.
- A security plugin firewall such as Wordfence or similar tools, which checks traffic after it reaches your site.
Many hosting companies also include basic firewall protection, so ask yours what they offer.
Step 11: Back Up Your Website Every Day
Even the best protection can fail sometimes. A backup is your “undo” button. If your site gets hacked, you can go back to a clean version.
- Back up both your files and your database.
- Store backups away from your website, such as in cloud storage.
- Keep several versions, not just the newest.
- Test a restore once in a while to be sure it works.
Step 12: What If You Were Already Hacked?
Signs that your site may be hacked include spam posts you did not write, strange pages in Google results, sudden redirects to other websites, new admin users, or a warning from your host or Google.
Do not panic. Here is a calm plan:
- Take a backup of the current state, so you have something to study.
- Tell your hosting company. Many can help scan and clean the site.
- Change all passwords: WordPress admin, hosting, database, FTP and email.
- Delete unknown admin users.
- Run a malware scan with a trusted security plugin or your host’s scanner.
- Restore a clean backup if you have one from before the problem started.
- Reinstall WordPress core files and update every plugin and theme.
- Remove spam posts, pages and links.
- Check Google Search Console. Look at the Security issues and Manual actions reports, and ask Google to review the site once it is clean.
- Find the hole. If you do not find how they got in, they may come back.
If this feels too hard, hire a trusted WordPress security professional. It is worth the cost compared with a ruined website.
Spam-Fighting Settings at a Glance
| Problem | Best Fix |
|---|---|
| Spam comments | Comment rules, Akismet, close old posts |
| Contact form spam | CAPTCHA or honeypot, spam filter |
| Fake user sign-ups | Turn off registration, email check, admin approval |
| Spam posts you did not write | Check for hacking, change passwords, scan, restore backup |
| Login attacks | Limit attempts, 2FA, strong passwords |
| Bots overall | Firewall such as Cloudflare or a security plugin |
Monthly Security Routine (10 Minutes)
- Check for updates and install them.
- Look through your user list for strangers.
- Review the spam folder in case a real comment landed there.
- Check that backups are running.
- Look at Google Search Console for any security warnings.
- Remove plugins and themes you no longer use.
Simple Word List (Glossary)
- Spam: Unwanted junk messages or content.
- Bot: A small program that visits websites automatically.
- CAPTCHA: A test that checks you are a human.
- Honeypot: A hidden trap box that only bots fill in.
- Brute force attack: Trying many passwords until one works.
- 2FA: A second step at login, like a code on your phone.
- Firewall (WAF): A shield that blocks bad traffic.
- Malware: Harmful software that damages or controls a website.
- Backup: A saved copy of your website.
- XML-RPC: An older WordPress feature that bots sometimes misuse.
Frequently Asked Questions (FAQ)
Why is my WordPress site getting so much spam?
Bots scan the internet looking for any website they can reach. Open comments, open registration and weak login pages make your site an easy target.
How do I stop spam comments in WordPress for free?
Use the settings under Settings → Discussion, close comments on old posts and install a free anti-spam plugin. Akismet is free for personal blogs.
How do I stop fake user registrations?
Turn off “Anyone can register” if you do not need it. If you do, add email verification, admin approval or a bot check.
Why are there posts on my site that I did not write?
This usually means someone gained access to your site, often through a weak password, an old plugin or a fake admin account. Follow the clean-up steps in Step 12.
Does CAPTCHA stop all spam?
No. It helps, but smart bots can sometimes get past it. Combine it with other protections, such as a firewall and email verification.
Do I need a security plugin?
It is not required, but a good one makes things easier by adding a firewall, login protection and scans. Choose one well-known plugin and keep it updated.
Can spam hurt my Google ranking?
Yes. Spam links and hacked content can make your site look low quality or unsafe, which can lower your rankings.
Final Thoughts
Stopping WordPress spam is not about one magic setting. It is about building several small walls: smart comment rules, a spam filter, a bot check, a protected login, regular updates and daily backups. Each layer makes life harder for bots.
Start today with three easy jobs: turn off open registration, set your comment rules and update your plugins. Then work through the rest of the steps over the week. Your website, your visitors and your Google ranking will all thank you.
Have you ever dealt with spam on your site? Share your experience in the comments. For more easy WordPress and tech guides, keep following Connect Digital World.
Sources and further reading: WordPress.org security guidance, public WordPress security guides from hosting and security companies, and vulnerability data from the Wordfence Intelligence database. Plugin features and prices change, so check each official page.

