A complete step-by-step recovery guide – from immediate containment to long-term protection. Most sites can be fully restored within hours.
- WordPress powers 43%+ of all websites – making it the most targeted CMS by automated attacks worldwide.
- Immediate steps: Take your site offline, change all passwords, scan for malware.
- Recovery: Restore a clean backup OR manually remove infected files and unknown users.
- Prevention: Install a security plugin, enable a firewall, use 2FA, and keep all software updated.
- Most hacks exploit outdated plugins, weak passwords, or nulled themes – not WordPress core itself.
How to tell if your WordPress site has been hacked
Before attempting any fix, confirm the compromise. Rushing a cleanup on the wrong assumption wastes time and can make things worse.
Act fast. Every minute your site stays online, hackers can dig deeper, steal data, or use your server to attack others.
- ⚠Change ALL passwords – WordPress admin, hosting account, FTP/SFTP, and database (phpMyAdmin)
- ⚠Put your site in maintenance mode to stop visitors from being exposed to malware
- ⚠Revoke and regenerate all API keys and secret keys in wp-config.php
- ⚠Notify your hosting provider – many have emergency response protocols
Identify every infected file before removing anything. Blind deletion can break your site.
Recommended security scanning tools
What to look for during a scan
- ⚠Suspicious PHP files appearing in unexpected locations
- ⚠Obfuscated code – long random-looking character strings
- ⚠Unknown scripts injected into theme files (functions.php, header.php)
- ⚠Modified core WordPress files (compare against official checksums)
Where WordPress vulnerabilities actually come from
Understanding the source of most attacks helps you prioritise your security investments correctly.
Sources: Wordfence and Sucuri annual security reports.
You have two paths. Choose based on whether you have a clean backup.
Cleaning is only half the job. If the original vulnerability is still open, attackers will return within hours.
Typical WordPress hack recovery timeline
Most sites are fully operational within 6 hours when a clean backup is available.
A hacked site can be blacklisted by Google, destroying your search rankings. Act quickly to minimise the damage.
- ✓Open Google Search Console and check the Security Issues report
- ✓Submit a security review request once your site is clean
- ✓Check for manual actions in the Manual Actions panel
- ✓Request reconsideration if your site was manually penalised
- ✓Monitor organic traffic closely for 4-6 weeks after cleanup
Why most WordPress hacks are not personal
This matters because it changes your defence strategy. You do not need to be impenetrable – you just need to be better secured than the average WordPress site. Most bots move on quickly when they hit resistance.
Pro-level WordPress hardening (advanced)
Once your site is clean, these advanced measures will substantially reduce the chance of a repeat attack.
- ✓Disable file editing in WordPress – add
define('DISALLOW_FILE_EDIT', true);to wp-config.php - ✓Change the default login URL away from /wp-admin using a security plugin
- ✓Implement a Web Application Firewall (WAF) – Cloudflare free plan works well for most sites
- ✓Block XML-RPC attacks if you do not use the WordPress mobile app or Jetpack
- ✓Set correct file permissions: directories at 755, files at 644, wp-config.php at 440
- ✓Never install nulled (pirated) themes or plugins – they are the single fastest path to compromise
Frequently asked questions
- ✓ Change all passwords immediately and revoke all API keys
- ✓ Scan with Wordfence or Sucuri before removing anything
- ✓ Restore from a verified clean backup wherever possible
- ✓ Install a security plugin and firewall after cleanup
- ✓ Update WordPress core, all plugins, and all themes
- ✓ Enable two-factor authentication on all admin accounts
- ✓ Submit Google Search Console security review within 24 hours
- ✓ Biggest mistake: fixing the hack but not the underlying vulnerability
Getting hacked feels scary – but it is fixable.
What actually matters is what you do after the hack.
Secure it once, secure it properly – and you will likely never deal with this again.




