WordPress itself is well maintained and patched quickly when problems are found. Most compromised WordPress sites are broken into through something around it: an outdated plugin, a weak password, an abandoned admin account or a hosting setup nobody checks. The good news is that a handful of habits close most of those doors. These are the steps we put in place on every WordPress site we look after, roughly in order of impact.

1. Keep everything updated

  • Core, plugins and themes. Apply updates promptly, especially those marked as security fixes. Outdated plugins are the most common way in.
  • PHP. Run a PHP version that still receives security support. Your host's control panel shows which version the site uses.
  • Test before you update a busy site. A staging copy lets you apply updates and check the site before they reach customers.

2. Cut the plugin list

Every plugin is code someone else wrote, running on your site. Remove plugins and themes you do not use, rather than just deactivating them. Before installing anything new, check that it is actively maintained, recently updated and widely used, and prefer one well-built plugin over three that overlap.

3. Lock down logins

  • Strong, unique passwords. Use a password manager so no account reuses a password from another site.
  • Two-factor authentication. Turn it on for every account that can publish or change settings.
  • Limit login attempts. Slow down automated password guessing with a login limit or a firewall rule.
  • Avoid obvious usernames. An administrator account named "admin" makes guessing easier.

4. Give people only the access they need

WordPress roles exist for a reason. Most people who write content need the Editor or Author role, not Administrator. Review the user list regularly and remove accounts for people who have left or projects that have ended. Shared logins make it impossible to tell who changed what, so give each person their own account.

5. Back up off the server

Backups are what turn a bad day into a short one. Back up both the files and the database automatically, keep copies somewhere other than the web server, and keep several days or weeks of history so you can roll back to a clean point. Most importantly, test a restore now and then. A backup you have never restored is a hope, not a plan.

6. Harden the setup

  • HTTPS everywhere. Serve every page over a valid certificate and redirect plain HTTP.
  • Turn off the built-in file editor. Setting DISALLOW_FILE_EDIT in wp-config.php stops anyone who gets into the dashboard from editing theme and plugin code there.
  • Sensible file permissions. The web server should not be able to write to files it does not need to change.
  • Security headers and a firewall. Headers such as a Content Security Policy limit what a compromised page can do, and a web application firewall blocks many common attacks before they reach WordPress.

7. Choose hosting that helps

Good hosting isolates your site from other customers' sites, keeps server software patched, and offers backups, a staging copy and a firewall. Cheap shared hosting that does none of this pushes all of that work back onto you.

8. Watch for trouble

Set up uptime monitoring, keep an eye on Search Console for security warnings, and use a security plugin or service that alerts you to changed files and new admin users. The sooner you notice a problem, the less it costs to fix. Our WordPress maintenance checklist shows how these checks fit into a weekly and monthly routine.

Want someone to look after it?

We build and maintain WordPress sites with updates, backups and monitoring handled for you, and we clean up and harden sites that have already been compromised. If you are not sure how secure your site is, we are happy to take a look.