The most effective WordPress security is boring hygiene: updates, strong separate passwords with two-factor login, few vetted plugins and backups you can actually restore. Below are 12 steps, most important first, each with a short reason.
Why WordPress is a target
WordPress powers a huge share of the web, so attackers scan the internet with automated tools looking for known vulnerabilities. A small business site does not have to be an “interesting target”. An outdated plugin is enough.
The good news: most break-ins start with simple neglect. That is why the list below is mostly housekeeping, with no magic tools.
The basics: steps 1-4
- Update core, theme and plugins. New versions patch known vulnerabilities, and known vulnerabilities are what the automated scanners look for first. Turn on automatic minor updates and review the rest on a fixed schedule, for example once a week.
- Remove what you don’t use. An inactive plugin or theme still sits on the server and can still have a vulnerability. Less code means fewer places for a vulnerability to hide.
- Use strong, separate passwords. Ideally from a password manager. A password reused across several services is only as strong as the weakest of them.
- Turn on two-factor login for administrators. Even a leaked password is then not enough to get into the dashboard. The official Two Factor plugin, developed by the WordPress team, is a good choice. Save the recovery codes so you don’t lock yourself out.
Access: steps 5-7
- Limit accounts and permissions. Give the administrator role only where it is truly needed. Delete accounts of former employees and contractors instead of leaving them “for later”.
- Make password guessing harder and don’t expose usernames. Limit login attempts and turn off public user lists (author pages and the API endpoint that lists users), because that is where attackers get usernames.
- Switch off what you don’t need. XML-RPC, if nothing uses it, and the file editor in the dashboard (the
DISALLOW_FILE_EDITconstant), so that a hijacked account cannot change code right away.
Server configuration: steps 8-9
- Force HTTPS and set security headers. HSTS, X-Content-Type-Options, X-Frame-Options and a content security policy (CSP, in report-only mode to start with). How to check this without technical knowledge is covered in the article How to check if your site leaks data.
- Block PHP execution in the uploads directory and hide version numbers. An uploaded file should never be able to run as code, and version numbers are a hint for scanners.
Maintenance: steps 10-12
- Keep backups off the server and test the restore. A backup that sits only on the same server disappears together with the site. I wrote about costs and rules in the article What a website really costs to run.
- Monitor availability and changes. A notification that the site is not responding or that files have changed lets you react in minutes, not weeks.
- Have a plan for when things break. Who does what, in which order: restore the backup, change all passwords, update, check for new accounts. A plan written down in advance saves hours of panic.
What to avoid
- Themes and plugins from illegal sources (“nulled”). This is one of the most common routes to a break-in, because they contain added malicious code.
- Several security plugins at once. Each one is extra code and potential conflicts, and none of them replaces the hygiene from the list above.
- Putting off updates “because something might break”. It is better to have a backup and update than to hope nobody knows about the vulnerability.
How it looks on my site
On this site (case study) I use most of the above. XML-RPC and the file editor are switched off, versions and usernames are hidden, and PHP execution in uploaded files is blocked. On top of that: limited login attempts, security headers and two-factor login. You get this setup from day one in a WordPress website, and you can find more terms in the glossary.
Key takeaway
Most break-ins on small business sites start with an outdated plugin, a weak password and no backup. Start with steps 1-4.