Redirects to spam sites, a Google warning, strange new admin users, or a host suspension notice: if you are seeing any of these, your site has probably been hacked. Do not panic, and do not start deleting things yet. Here is what to do, in order.
Signs your site is hacked
- Visitors (often only on mobile or from Google) get redirected to another site
- Google shows “This site may be hacked” or Chrome shows a red warning page
- Admin users, pages or files you did not create
- Your host suspended the account for malware or spam sending
- Search results show your site with spammy titles in other languages
The first hour
- Take a backup of the hacked site as it is. It sounds backwards, but it preserves evidence and gives you something to go back to if cleanup goes wrong.
- Change passwords: WordPress admins, hosting, SFTP and the database. Use a password manager.
- Remove unknown admin users under Users.
- Tell your host. They may have logs showing how the attacker got in, and some will help with cleanup.
- Do not just restore an old backup and move on. If the hole is still open, the attacker comes right back.
How a proper cleanup works
- Scan files and the database for malware (a malware scanner plus a manual look at recently modified files).
- Replace WordPress core, plugins and themes with fresh copies from their official sources rather than trying to clean them.
- Clean injected code out of the database,
wp-config.php,.htaccessand the uploads folder (PHP files there are a red flag). - Find how they got in: usually an outdated or abandoned plugin, a nulled premium plugin, or a stolen password.
- Close the hole, then reset all passwords and security keys (salts) in
wp-config.php. - Request a review in Google Search Console to remove any warning.
Keep it from happening again
- Keep everything updated, and remove unused plugins and themes
- Two-factor authentication for every admin
- A security plugin with login protection and file change alerts (see our pick)
- Daily off-site backups (see our backup guide)
- Never use nulled or “free” copies of premium plugins
Want it cleaned up for you?
Our hack recovery service removes the malware, finds how they got in, closes it, and gets Google warnings lifted. Every Care Plan includes the monitoring and updates that keep it from happening again.