Hacked WordPress Site? What to Do in the First Hour
Finding out your site has been hacked is stressful, and panic leads to mistakes: deleting the wrong files, losing your content, or cleaning only the visible damage and leaving a backdoor behind. Work through these steps calmly, in order.
Signs your site may be hacked
- Google shows "This site may be hacked" or "Deceptive site ahead".
- Visitors are sent to spam, casino or pharmacy sites.
- Strange pages or links appear in your Google results.
- Your host suspends the account or sends a malware notice.
- You find admin users you did not create, or you are locked out.
- The site suddenly becomes very slow, or your email stops sending.
The first hour: what to do, in order
- Do not delete everything. You could lose your content and destroy evidence of how they got in.
- Contact your host. They may have server-side logs, scan results and clean backups, and some hosts will help with cleanup.
- Take a backup of the site as it is now, files and database, and keep it separate. Even an infected backup is useful for investigation.
- Change every password: WordPress admins, hosting panel, FTP or SFTP, database and the email account tied to the site. Do this from a clean device.
- Put the site in maintenance mode if it is redirecting or attacking visitors, so you stop harming them.
- Check your admin users. Remove any account you do not recognise.
Cleaning the site
There are two routes: restore a clean backup, or clean the infection manually. Restoring a backup from before the hack is the quickest option, but only if you are sure the backup is clean and you then close the hole that let the attacker in. Otherwise you will be hacked again.
For a manual cleanup, the work includes:
- Replacing WordPress core files with fresh copies.
- Reinstalling plugins and themes from trusted sources and deleting any you do not use.
- Searching the
wp-contentfolder, uploads,.htaccessandwp-config.phpfor injected code and backdoors. - Checking the database for injected scripts, spam posts and rogue users.
- Checking scheduled tasks that might reinstall the malware.
This is detailed work. A security plugin scan alone often misses hidden backdoors, so do not assume a "clean" scan means the site is safe.
Remove the Google warning
Once the site is genuinely clean, open Google Search Console, go to the Security issues report, and request a review. Google decides when the warning is removed, so it can take some time. If you request a review while the site is still infected, it will be rejected, so clean first.
Why sites get hacked again
- The vulnerable plugin or theme that let them in is still installed.
- A backdoor file was missed during cleanup.
- Passwords were reused or not changed.
- The site uses "nulled" (pirated) plugins or themes.
- Other sites on the same account are still infected and reinfect this one.
Hardening: how to make it harder next time
- Keep WordPress, plugins and themes updated, and remove the ones you do not use.
- Use strong, unique passwords and two-factor login for every admin.
- Add a firewall and limit login attempts.
- Run automatic, off-site backups and test restoring one.
- Disable the built-in file editor and fix file permissions.
No site can be made impossible to hack. The goal is to close the obvious doors and be able to recover quickly.
Want it done properly?
If you would rather have a specialist handle it, see my malware removal and security service, or message me through the contact form with your link and what you are seeing.
Frequently asked questions
Can I fix a hacked WordPress site myself?
Sometimes, if the infection is simple and you have a clean backup. Hidden backdoors are the problem: if you miss one, the site gets reinfected. If the site earns money or holds customer data, a specialist is usually the safer choice.
Will I lose my content?
Not if the cleanup is done carefully. Take a full backup before changing anything, and clean the infection rather than wiping the site.
How long does Google take to remove the warning?
It varies. Google reviews the request after you submit it from Search Console, and it only succeeds if the site is clean.
