If your WordPress site has been hacked, you are not alone and you are not especially unlucky. WordPress powers over 40% of the web, which makes it the largest target. The attacks are almost never personal. Automated bots scan millions of sites continuously, looking for known vulnerabilities, and they find them constantly.
The good news: the overwhelming majority of WordPress hacks are preventable. Here is why they happen and what stops them.
Reason 1: Outdated Plugins and Themes
This is the most common entry point by a significant margin. When a vulnerability is discovered in a plugin or theme, the developer releases a patch. Security researchers then publish details of the vulnerability — which means attackers know exactly what to look for in unpatched sites.
Wordfence reports that over 55% of WordPress infections they investigate trace back to vulnerable plugins. The window between a vulnerability being disclosed and bots scanning for it is often less than 24 hours.
What to do: Enable automatic updates for plugins and themes, or check for updates weekly. If a plugin has not been updated in over a year and has unresolved security reports, replace it.
Reason 2: Nulled or Cracked Plugins and Themes
Nulled plugins — cracked copies of premium plugins distributed for free on third-party sites — almost always contain injected malware. Studies consistently find malicious code in the majority of nulled plugins analyzed.
The injections typically install backdoors, create hidden admin accounts, or redirect visitors to spam sites. They are designed to persist through cleanups and are often obfuscated to look like legitimate code.
What to do: Only install plugins from WordPress.org or the original developer’s site. Never use nulled or cracked plugins, regardless of how legitimate the source appears.
Reason 3: Weak or Reused Passwords
Brute force attacks — automated tools trying thousands of username and password combinations against your wp-admin login — are constantly running against WordPress sites. Default usernames like “admin” make this easier. Reused passwords from other breached services make it trivial.
What to do:
- Use a strong, unique password for your WordPress admin account
- Rename or delete the default “admin” username
- Enable two-factor authentication on your admin account
- Limit login attempts with a plugin like Limit Login Attempts Reloaded
Reason 4: Poor Hosting Environment
Shared hosting means multiple sites share the same server. If the host does not properly isolate accounts, a compromised site on the same server can infect yours through the shared filesystem. This is called cross-site contamination and it is more common on cheap shared hosting than most hosts admit.
What to do: Choose a host that isolates accounts properly. Managed WordPress hosts (WP Engine, Kinsta, Flywheel) are built for this. A host that offers malware scanning and automatic cleanup is worth the extra cost.
Reason 5: Outdated PHP Version
An outdated PHP version means your server is running software past its end of life, with known vulnerabilities and no security patches. PHP 7.4 reached end of life in November 2022. PHP 8.0 ended in November 2023. Sites still running these versions are exposed to unpatched vulnerabilities at the server level.
What to do: Check your PHP version in your hosting control panel and update to PHP 8.2 or 8.3. Also ensure your site uses HTTPS — most hosts provide free SSL via Let’s Encrypt.
Reason 6: Unused Plugins and Themes Left Installed
Deactivated plugins still exist on your server. If they contain vulnerabilities, those vulnerabilities can still be exploited even when the plugin is not active. The same applies to themes — the default WordPress themes you never use but never deleted.
What to do: Delete plugins and themes you are not using. Deactivated is not safe enough. If it is on your server, it is a potential entry point.
Reason 7: No Security Monitoring
Most site owners discover they have been hacked when a visitor tells them, or when Google shows the “this site may be harmful” warning in search results. By that point, the infection has often been in place for weeks.
What to do: Install a security plugin with malware scanning (Wordfence, MalCare, or Solid Security are well-regarded options). Enable email alerts for failed logins, file changes, and new admin account creation.
What to Do Right Now
If you have not already:
- Update everything — WordPress core, all plugins, all themes
- Delete unused plugins and themes — do not just deactivate
- Strengthen your admin password and enable two-factor authentication
- Install a security plugin with active malware scanning
- Check your PHP version and update if below 8.1
- Verify your host’s isolation policy — if they cannot tell you, consider switching
None of these steps are complicated. Most take less than 30 minutes total. That 30 minutes is the difference between a site that runs cleanly and one that becomes a liability.
If You Have Already Been Hacked
Remove all nulled plugins immediately if present. Run a full malware scan. Check the admin user list for accounts you did not create. Change all passwords. If the scan finds infection, engage a professional cleanup service — incomplete cleanup leaves backdoors in place and the site will be reinfected.
After cleanup, work through the prevention steps above before bringing the site back online. A cleaned site that still runs outdated plugins will be reinfected within days.
Keep your WordPress site secure with properly licensed, regularly updated plugins. Browse WP Prism plugins — clean code, active support, and updates you can actually install.
