WordPress site hacked? What to do in the first hour

Your site redirects visitors to a casino, Google shows a red warning, or your hosting provider has suspended the account for sending spam. A hacked site is stressful, but the first hour matters more than speed. Rushed fixes often remove the visible symptom and leave the back door open. Here is the order we follow.
1. Confirm and record what you see
- Take screenshots of the problem, any warning in Google Search Console and messages from your host.
- Note the time you first noticed it. You will need this to choose a clean backup.
- Check from another device and network. Some malware only shows itself to visitors coming from Google or on mobile.
2. Contain the damage
- Put the site into maintenance mode or ask your host to block public access temporarily. A hacked site can infect visitors and damage your search reputation every hour it stays online.
- Do not delete anything yet. Files and logs are evidence of how the attacker got in.
- Download a full copy of the current files and database for later analysis.
3. Lock the doors
- Change the passwords for hosting, the control panel, FTP or SFTP, the database and email accounts linked to the site.
- In WordPress, review the list of administrators and remove any account you do not recognise.
- Change all administrator passwords and turn on two-factor authentication.
- Change the security keys and salts in
wp-config.php. This logs out everyone, including the attacker.
4. Restore from a clean backup
The fastest safe fix is a backup from before the infection. Choose one older than the first sign of trouble, and older still if you do not know when it started. After restoring, update WordPress, the theme and every plugin immediately, otherwise the same hole will be used again within days. This is why we recommend tested backups kept outside the hosting account.
No usable backup? Then the site has to be cleaned by hand: compare core files with fresh copies, reinstall plugins from the official source, search the database and uploads folder for injected code. This takes experience and time, and it is easy to miss a hidden file.
5. Find how they got in
If you do not close the entry point, the attack will repeat. The usual causes are:
- An outdated plugin or theme with a known vulnerability, by far the most common.
- A “nulled” paid plugin downloaded from an unofficial site.
- A weak or reused administrator password without two-factor authentication.
- Another infected site on the same hosting account.
Your host’s access logs usually show the requests that uploaded the malicious files.
6. Clean up the after-effects
- When the site is clean, request a review in Google Search Console to remove the security warning.
- Check whether your domain was put on email blacklists if the site sent spam.
- If the site stored personal data, such as customer accounts or orders, assess whether it was exposed. Under the GDPR a personal data breach may have to be reported to the supervisory authority within 72 hours.
Prevent the next one
Most hacks we see would have been stopped by regular updates, two-factor authentication and a firewall. Our WordPress maintenance checklist and website security checklist list what to do every month. You can also run the free website check to see outdated WordPress versions and missing security headers.
Need help right now?
Hack cleanup is included in our Web Standard and Web Pro plans, and we take one-off emergency cases too. Use emergency help and we will quote the price before we start.


