Most WordPress sites aren't hacked by someone targeting them. They're found by bots that scan thousands of sites an hour, looking for one of a few known weaknesses. Close those, and you're no longer an easy target.
Here's what we actually see in server logs, in order of how often it works.
1. Outdated plugins
This is the big one. When a plugin vulnerability is published, bots start scanning for it within days. If you're running the old version, it doesn't matter how strong your password is.
What to do:
- Turn on auto-updates for plugins from established developers (Plugins → Enable auto-updates).
- Once a week, log in and check Dashboard → Updates for anything that didn't update itself.
- If a plugin hasn't been updated by its developer in over a year, replace it. "Tested up to" on its WordPress.org page tells you how stale it is.
2. Nulled (pirated) themes and plugins
Premium themes downloaded free from "GPL" or "nulled" sites very often contain hidden code that creates admin accounts or injects spam links. It's the most common cause of the "my site is redirecting to a betting site" tickets we get. We wrote about this in more detail in Why nulled plugins get WordPress sites hacked.
What to do: buy from the developer, or use a free theme from WordPress.org. If you've already installed a nulled one, replace it and change every admin password.
3. Password guessing on wp-login.php
Bots try common usernames (admin, your domain name, the author name shown on posts) with lists of leaked passwords.
What to do:
- Don't use
adminas a username. If you did, create a new administrator, log in as them, and delete the old one (WordPress lets you assign its posts to the new user). - Use a generated password of at least 16 characters.
- Add two-factor login with a plugin such as Two Factor (by the WordPress.org community) or Wordfence Login Security. Use an authenticator app like Google Authenticator or Microsoft Authenticator.
- Limit login attempts. Wordfence or Limit Login Attempts Reloaded both do this.
4. XML-RPC
xmlrpc.php is an old remote-publishing interface. Bots use it to test many passwords in a single request. Unless you use the Jetpack plugin or publish from the old WordPress mobile app, you don't need it.
What to do: most security plugins have a "Disable XML-RPC" switch. Or add this to the top of the .htaccess file in your site folder (cPanel → File Manager, tick Show Hidden Files in Settings):
<Files xmlrpc.php>
Require all denied
</Files>
5. File editing from the dashboard
If someone gets into an admin account, the built-in theme and plugin editor lets them change PHP code directly. Turn it off by adding one line to wp-config.php, above the line that says "That's all, stop editing!":
define('DISALLOW_FILE_EDIT', true);
6. Too many administrators
Every admin account is another password that can leak. Shop staff, writers and your nephew who set up the site don't need the Administrator role. Use Editor, Author or Shop manager (WooCommerce) instead, and remove people who no longer work with you.
Backups are your safety net
Your hosting has daily backups, so a bad update or a hack doesn't have to be the end. But a backup only helps if you notice the problem before the clean copies are replaced, so look at your site regularly and act quickly when something looks off. Keep your own copy too; see Keep backups you control.
If your site is already hacked
- Don't delete everything in a panic. Open a ticket first; we can check the backups and tell you which date is clean.
- Change your cPanel, WordPress admin and database passwords.
- Restore a clean backup (how backups work), then update everything immediately, before the bot comes back.
Stuck on a step?
Customers can open a ticket from the client area and an engineer will do it with you. Not a customer yet? Write to help@hostingdon.com or call +91 98002 55199.