How to secure WordPress site in 2026 starts not with a single plugin, but with a stack of small, boring habits. Most WordPress break-ins do not come through brilliant hacking. They come through a weak password, an out-of-date plugin, a login page left open to unlimited guesses, or a backup that was never tested. This guide fixes those doors one at a time, in the order that matters most.
Contents
- How to secure WordPress site with two-factor authentication
- Update everything, and delete what you do not use
- Limit logins and use strong, unique passwords
- Backups you have actually tested
- Harden files and hide nothing that matters
- Add a firewall and scanning on sites that earn or hold users
- If your site is hacked, do this first
- Related reads
How to secure WordPress site with two-factor authentication
How to secure WordPress site logins starts with two-factor authentication, because WordPress core still does not ship 2FA built in. You add it with a maintained plugin, such as the community Two Factor plugin or WP 2FA, and you require it for every administrator and editor. An authenticator app or a hardware security key is stronger than a text message code, and a passkey-style WebAuthn method, where your plugin supports it, is stronger still. SMS codes are a last resort, not a first choice, because phone-number attacks can intercept them.
Set up 2FA before you need it, and save the backup codes your plugin gives you somewhere safe and offline. Test the recovery path while you can still sign in, because a second factor you cannot recover from is a lockout waiting to happen. Also review application passwords, which bypass 2FA by design for tools that connect to WordPress. Delete any application password you no longer recognise, since a forgotten one is a permanent back door.
Update everything, and delete what you do not use
Out-of-date plugins and themes remain the largest entry point into WordPress sites, ahead of core itself. Enable automatic updates for minor WordPress core releases, which are security patches, and apply major updates promptly after a backup. Do the same for plugins and themes you trust, and check your PHP version with your host, since old PHP versions stop receiving security fixes. A site running current core, plugins, themes and PHP closes most known holes before an attacker can use them.
Then delete what you do not use. Every inactive plugin and theme is still code on your server, and it can still be exploited if it contains a flaw. Remove unused plugins and themes entirely, rather than just deactivating them, and only install plugins from the official directory or a developer you trust.
Before installing anything new, check when it was last updated, how many sites use it, and whether its reviews mention abandoned support. A popular, maintained plugin is usually safer than a clever-looking one nobody updates.
Limit logins and use strong, unique passwords
Never use “admin” as a username, and never reuse a password from another site. Create a long, unique password for every WordPress account, ideally with a password manager, and give each person only the role they actually need. An author who only writes posts does not need administrator rights, and every extra administrator is an extra target. Review your user list regularly and remove accounts for people who no longer work on the site.
Limiting login attempts stops the simplest attack of all: guessing passwords thousands of times. Use a maintained login-limit plugin, or the login protection built into a security plugin, and lock an address out after a handful of failed attempts. A reasonable starting point is five failures followed by a lockout of twenty to sixty minutes. This step does not stop a stolen password, which is why it pairs with 2FA, but it stops most automated guessing cold.
Backups you have actually tested
A backup you have never restored is a hope, not a backup. Set up regular, automatic backups of both your files and your database, and store at least one copy away from your hosting account. Then test a restore on a staging copy or a test install, so you know the backup is complete and usable. If your site is ever hacked, a clean, tested backup is what turns a disaster into a bad afternoon.
Keep backups frequent enough to match how often your site changes. A blog that publishes weekly can live with weekly backups, while a shop or membership site needs daily ones. Label backups by date, keep several recent copies, and do not rely on your host’s backup alone unless you have confirmed what it covers and how to restore from it. Write the restore steps down where you can find them under stress, not just in your head.
Harden files and hide nothing that matters
File hardening sounds technical, but the useful parts are simple settings. Disable the built-in theme and plugin file editor, so a stolen admin session cannot instantly become code running on your server. Set sensible file permissions with your host’s help — directories and files locked down, and the wp-config file tighter still — and do not edit permission numbers you do not understand without host support. These settings slow an attacker down and limit what a single flaw can do.
Do not waste effort on hiding your WordPress version. The old advice to delete a version line from a theme file does not stop modern attacks, which test for flaws directly rather than reading a version number. Spend that time on updates, 2FA and backups instead, because those are the controls that actually block real attacks. Similarly, do not rely on hiding your plugins folder: a determined attacker can still probe for known plugins, while a maintained, updated plugin list is a real defence.
Add a firewall and scanning on sites that earn or hold users
For a personal blog, the steps above may be enough. For a site that earns money, runs a shop, or holds member data, add a web application firewall and malware scanning. A firewall blocks common attack patterns before they reach WordPress, and a scanner plus an activity log tells you what changed, when, and by whom. Many hosts include these tools, and reputable security plugins offer them too, so check what your host already provides before buying another tool.
Use HTTPS everywhere, with a valid certificate, and make sure your site does not mix secure and insecure content. HTTPS protects logins and data in transit, and browsers now warn visitors away from insecure sites. If your host offers free certificates, turn one on and check that every page loads securely. This step is basic in 2026, but it is still missed on older sites that were set up before HTTPS became standard.
If your site is hacked, do this first
If you suspect a hack, do not panic and do not just reinstall the same vulnerable setup. Change all administrator passwords, revoke application passwords, and force a password reset for other users if your plugin supports it. Restore from a clean backup made before the intrusion, then update everything and scan again. Check for new administrator accounts, unknown scheduled tasks, and files you did not create, and ask your host for help if you cannot find the entry point.
After recovery, close the hole that let the attacker in, or the same attack will return. That usually means updating or removing one plugin, tightening one account, or turning on 2FA that was missing. Keep a short note of what happened and what you fixed, because that note is what stops the next incident. Security is not a one-time setup: it is the habit of updating, checking and backing up, repeated.
Related reads
- Differences Between WordPress.com and WordPress.org — on WordPress.com, Automattic handles much of this for you; on self-hosted WordPress, this checklist is your job.
- How to Protect Your Gmail Account From Hackers — the same 2FA and recovery habits protect your email, which protects every password reset.