Most hacked WordPress sites were not targeted by anyone. A bot tried a known hole in an old plugin, or a password leaked from another service, on thousands of sites at once, and yours answered.
That is good news, because bots are predictable. The measures below are ordered by how much they help. The first five stop the large majority of attacks, so do those today and leave the rest for another afternoon.
Make a backup before you change configuration files.
The short version
| Do this | It stops |
|---|---|
| Update everything | Known holes in plugins and themes |
| Delete what you don't use | Holes in things you forgot |
| Unique passwords and two-factor sign-in | Stolen and guessed passwords |
| Backups in another place | Losing the site |
| Hosting that isolates and updates | Attacks from neighbors and old software |
The five that matter most
1. Keep WordPress, plugins and themes up to date
Go to Dashboard → Updates every week, or turn on automatic updates plugin by plugin in Plugins → Installed Plugins. WordPress installs its own security releases by itself; check that nobody turned that off.
If you are afraid of breaking something, test on a staging copy first. Waiting a month out of caution is riskier than a small layout problem.
2. Delete what you don't use
A deactivated plugin still has its files on the server. Remove the plugins and themes you don't need, keeping one default theme for emergencies. Also remove plugins that have gone more than a year without an update or were closed on WordPress.org.
Never install "nulled" copies of paid products. They are one of the most common ways in.
3. Strong passwords and two-factor sign-in
Use a different, long password for each account and keep them in a password manager. Then add a second step for every administrator and editor. Two Factor is maintained by WordPress contributors and supports authenticator apps, email codes and backup codes.
Include the accounts people forget: hosting panel, domain registrar, email and database.
4. Back up to another place
A backup on the same server is lost with the server. Keep copies somewhere else, with several days of history, and practice restoring one. Our backup guide explains how often and where.
5. Choose hosting that does its part
Ask four questions: are sites isolated from each other, which PHP versions are supported, are there daily backups, and who helps if the site is hacked? As of November 2026, PHP 8.1 no longer receives security fixes and 8.2 stops at the end of December. Our managed WordPress hosting lets you select a version from 8.0 to 8.5 for each site, and includes daily backups and free SSL on every plan.
Protect the sign-in
6. Limit attempts and block known attackers
WordPress allows unlimited attempts. A security plugin adds limits and a firewall. Choose one; two of them get in each other's way.
| Plugin | Best for | Installs, rating (reviews) |
|---|---|---|
| Wordfence | Firewall and malware scan in one | 5 million+ 4.7 (5,057) |
| Limit Login Attempts | Only limiting sign-ins | 1 million+ 4.8 (1,493) |
| AIOS | Many settings without paying | 1 million+ 4.7 (1,721) |
| Sucuri Security | Audit log and file checks | 600,000+ 4.2 (386) |
| Patchstack | Warnings about vulnerable plugins | 100,000+ 4.8 (62) |
Phluit's own plugin, Barricade, comes with our WordPress hosting plans and covers the firewall, the scans and two-factor sign-in.
7. Give each person the right role
Writers should be authors or editors, not administrators. Work daily with an editor account and keep the administrator for maintenance. Review Users every three months and remove people who left, including the agency you no longer work with. Check Application Passwords in each administrator's profile too.
8. Don't use "admin" as a user name
Attackers always try it first. Create a new administrator with another name, sign in with it, delete the old one and assign its posts to the new one.
Close doors on the server
9. Turn off the file editor
The dashboard lets administrators edit plugin and theme code. If somebody steals a session, that is the fastest way to plant malware. Add this to wp-config.php, above the line that says to stop editing:
define( 'DISALLOW_FILE_EDIT', true );10. Block PHP in the uploads folder
There is no reason for PHP to run among your images. On Apache or LiteSpeed, create a file named .htaccess inside wp-content/uploads with this:
<FilesMatch "\.(?:php|phtml|phar)$">
Require all denied
</FilesMatch>On Nginx, the equivalent goes in the server configuration:
location ~* ^/wp-content/uploads/.*\.(?:php|phtml|phar)$ {
deny all;
}11. Set correct file permissions
Folders at 755, files at 644, and wp-config.php at 640 or 600. Nothing should be 777. From the site's folder:
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
chmod 640 wp-config.php12. Send everything over HTTPS
Install a certificate, redirect HTTP to HTTPS and force it in the dashboard with define( 'FORCE_SSL_ADMIN', true );. If you lack a certificate, see these free SSL plugins.
Measures with little effect
- Changing the table prefix of a site that already works. Risky, and it stops almost nobody.
- Hiding the WordPress version. Bots try the hole without asking.
- Moving the sign-in address. It reduces noise in your logs, but it doesn't replace two-factor sign-in.
- Disabling XML-RPC. Reasonable if you don't use the mobile app or Jetpack. It is still one door among many.
Keep watch
Security is a habit. Once a month:
- Install pending updates and delete what is no longer used.
- Review administrators and their last sign-ins.
- Run a malware scan.
- Check that yesterday's backup exists and opens.
- Look at Tools → Site Health.
Our checklist to find out whether your site is secure goes through these reviews one by one. If you would rather delegate them, Phluit Care includes updates and a monthly security review.
If you have already been hacked
Don't start deleting files. Save a copy, change passwords, and follow our guide to cleaning a hacked site. If the browser shows a red warning, also read how to remove "Deceptive site ahead".
Frequently asked questions
Is WordPress insecure?
The core is reviewed by many people and fixed quickly. Most problems come from outdated plugins, weak passwords and neglected sites.
Is a security plugin enough?
No. It helps with sign-ins and known attacks, but it can't make up for an old plugin or a shared password.
My site is small. Does it matter?
Yes. Bots don't look at size. They want your server to send spam, host fake pages or redirect your visitors.
