My WordPress site has been hacked - what do I do?
By Ash, Founder, HosteazePublished 3 min read
The short answer
If your WordPress site is hacked, stay calm and work in order. Write down what you're seeing, change every password and reset the security keys in wp-config.php, then restore a clean backup or replace WordPress files with fresh copies. Update everything, scan your own computer, and request a review in Google Search Console if Google has flagged the site.

Finding out your website has been hacked feels personal, and the instinct is to start deleting things. Don't, not yet. WordPress's own guidance on hacks starts with a surprisingly calm first step: write down what you're seeing. A clear order of work gets most small business sites back to normal faster than frantic clicking, and it stops you destroying the evidence of how they got in.
What should I do in the first hour?
- Write down the symptoms and when you noticed them: warnings, strange pages, new users, redirects. Note anything you changed recently, such as a new plugin.
- Take a copy of the site as it is now, infected or not. If a clean-up goes wrong, you'll want something to compare against.
- Tell your host. On shared hosting a hack can affect more than your site, and they may already be seeing it.
- Change every password: WordPress admin users, hosting control panel, SFTP and the database user. Then put the new database password into
wp-config.php. - Reset the security keys. Generate a new set at api.wordpress.org/secret-key/1.1/salt/ and paste them over the old ones in
wp-config.php. This logs out anyone still signed in, including the intruder. - In Users, delete any administrator accounts you don't recognise.
Should I restore a backup or clean the site?
| Option | When it makes sense | Watch out for |
|---|---|---|
| Restore a backup | You have a backup from before the hack started | You lose anything added since, and the hole is still open |
| Clean it yourself | No clean backup, and you're comfortable with SFTP | Hacks often add new files that are easy to miss |
| Hire a specialist | No clean backup, or the hack keeps coming back | Ask how they'll find the cause, not just the symptoms |
If you host with Hosteaze, backups are included, so ask about restoring from a date before the symptoms began. Either way, read the next section, because restoring alone doesn't fix how they got in.
How do I clean a hacked WordPress site?
- Scan the site with a security plugin from the WordPress.org directory, such as Wordfence or Sucuri Security, to find changed and suspicious files.
- Download a fresh copy of the same WordPress version you're running. Replace the
wp-adminandwp-includesfolders by SFTP, deleting the old ones rather than overwriting, since hacks often add extra files. - Delete every plugin and theme folder, then reinstall fresh copies from the official sources. Remove any you no longer use.
- Check
.htaccessandwp-config.phpby eye. WordPress names.htaccessas one of the files attackers most often change. - Look in
wp-content/uploadsfor.phpfiles. Uploads should be images and documents, not code. - Run a full antivirus scan on every computer used to log in. WordPress warns that some hacks start with stolen logins from an infected laptop.
What do I do about Google warnings?
Open Google Search Console and find the Security issues report. Once every listed issue is fixed on every page, select Request Review and describe what you found and what you fixed. Google says reviews can take from a few days to a few weeks. If you haven't set up Search Console, our guide on setting up Google Search Console shows how.
Hacked sites are often used to send spam, which can get your email blacklisted. If your emails start bouncing, see why your emails are going to spam.
How do I stop it happening again?
Common ways in include outdated plugins, weak or reused passwords, and themes or plugins downloaded from untrusted sites. Keep everything updated using a safe update routine, turn on two-factor login for admin accounts, and keep regular off-site backups. Our wider guide on protecting a website from hackers covers the rest.
Frequently asked questions
How do I know if my WordPress site has been hacked?
Common signs include Google showing a warning about your site, visitors' antivirus blocking it, unfamiliar admin users, pages you didn't create (often spam about pharmacies or gambling), redirects to other sites, or your host telling you the site is sending spam.
Do I have to report a hacked website to the ICO?
Only if personal data was involved and the breach is likely to put people's rights and freedoms at risk, for example customer names, emails or order details. Then UK GDPR requires you to tell the ICO without undue delay and, where feasible, within 72 hours of becoming aware. If the risk to people is high, you must tell them too.
Should I pay someone to clean my site?
If you don't have a clean backup and aren't comfortable comparing files, yes. A specialist will usually be faster and more thorough. Ask what they do to find the original vulnerability, because cleaning without closing the hole means you'll be hacked again.




