WordPress powers over 40% of all websites, which makes it the biggest target on the web. But here is the reassuring part: most hacked WordPress sites are not targeted personally. Automated bots scan millions of sites a day looking for weak passwords, outdated plugins and misconfigured servers. Close those doors and you stop the vast majority of attacks.
This guide covers the WordPress security best practices we apply to every client site, from quick wins you can do today to deeper hardening.
Why WordPress security matters
A compromised site is much more than an inconvenience:
- Customer data at risk: contact form entries, customer accounts and order details can be stolen.
- Lost revenue: a hacked site may be taken offline, redirect visitors to spam or stop taking orders.
- SEO damage: Google flags hacked sites with warnings and may remove them from results. Spam pages injected by hackers can damage rankings for months.
- Blacklisting: your domain can end up on email and browser blocklists, so even your emails stop arriving.
How WordPress sites get hacked
| Attack route | How it happens | Main defence |
|---|---|---|
| Vulnerable plugins and themes | Known flaws in outdated or abandoned code | Updates, fewer plugins, reputable sources |
| Brute-force logins | Bots guessing usernames and passwords | Strong passwords, 2FA, login limits |
| Insecure hosting | Outdated server software, shared accounts | Quality managed hosting |
| Nulled (pirated) themes and plugins | Malware bundled into “free” premium code | Only install from official sources |
| Stolen credentials | Reused passwords, phishing, compromised devices | Password manager, 2FA, least privilege |
Step 1: Secure your logins
- Use strong, unique passwords for every account, stored in a password manager.
- Enable two-factor authentication (2FA) for all administrators and editors.
- Limit login attempts to block brute-force attacks.
- Never use “admin” as a username, and remove accounts that are no longer needed.
- Give people the lowest role they need. Writers do not need to be administrators.
Step 2: Keep core, themes and plugins updated
Outdated plugins are the number-one cause of WordPress hacks. Most security updates fix publicly known vulnerabilities, which means bots start probing for them within days.
- Enable automatic updates for minor core releases and trusted plugins.
- Check for updates at least weekly; apply security releases immediately.
- Test major updates on a staging site first.
- Delete (not just deactivate) plugins and themes you no longer use.
Step 3: Choose secure hosting
Your host is your first line of defence. Look for:
- Isolated accounts (so a neighbouring site cannot infect yours)
- A current, supported version of PHP
- A server-level firewall and malware scanning
- Free SSL and automatic daily backups stored off-site
Managed WordPress hosting usually handles most of this for you.
Step 4: Install a security plugin and firewall
A good security plugin adds a web application firewall (WAF), malware scanning, login protection and alerts. Popular options include Wordfence, Solid Security and Sucuri. A cloud firewall such as Cloudflare adds another layer by blocking bad traffic before it reaches your server.
We compare the options in detail in the best WordPress security plugins.
Step 5: Back up automatically and test restores
Backups are your safety net when everything else fails.
- Run daily automatic backups (more often for busy stores).
- Store copies off-site, not just on the same server.
- Keep at least 30 days of history so you can restore to before an infection.
- Test a restore every few months. An untested backup is just a hope.
Step 6: Harden WordPress
These settings close common gaps:
- Force HTTPS across the whole site.
- Disable file editing in the dashboard by adding
define('DISALLOW_FILE_EDIT', true);towp-config.php. - Set correct file permissions (typically 644 for files and 755 for folders; 600 or 640 for
wp-config.php). - Disable XML-RPC if you do not use it (it is a common brute-force target).
- Add security headers such as
X-Content-Type-Optionsand a Content Security Policy. - Change the default database table prefix on new installs.
Step 7: Use themes and plugins from trusted sources only
- Download from WordPress.org or the developer’s official website.
- Check last-updated dates, active installs and reviews before installing.
- Never use nulled themes or plugins. They are one of the most common ways malware gets onto WordPress sites.
Step 8: Monitor your site
Security is ongoing. Set up:
- Uptime monitoring so you know immediately if the site goes down.
- Google Search Console alerts for security issues and manual actions.
- File change and login alerts from your security plugin.
- A monthly review of user accounts and installed plugins.
If you spot something odd, read the signs your website has been hacked and what to do.
WordPress security checklist
- Strong unique passwords and 2FA for all admin users
- Login attempts limited; no “admin” username
- Core, themes and plugins updated; unused ones deleted
- Secure hosting with a current PHP version and SSL
- Security plugin and firewall configured
- Daily off-site backups, with a tested restore
- File editing disabled; permissions and headers set
- Only official themes and plugins installed
- Uptime, login and Search Console monitoring active
Let us handle WordPress security for you
Security is easiest when it is someone’s job. Our WordPress maintenance plans cover updates, backups, firewall monitoring and uptime checks every month. If your site has already been compromised, our website security and malware removal service will clean it, close the hole and get any Google warnings removed. Contact Webyant today.
- wordpress security
- website security
- wordpress development
Jayanti Solanki
Founder, Webyant Technologies
For 17+ years, Jayanti has been turning designers' visions into websites that actually work: pixel-perfect, lightning-fast and built to convert. A Computer Applications honours graduate and certified Shopify Expert, Jayanti founded Webyant in 2016 and now leads a team crafting WordPress, Shopify, Webflow and Next.js websites (and, lately, AI assistants) for brands from Deesa to around the world. On this blog, Jayanti shares the practical, no-fluff lessons learned from shipping 100+ real projects.
Need help with this? Explore our services




