
Short answer: if your WordPress site has been hacked, don't start deleting files. First take a full backup of the files and database as evidence, then change every password (hosting, WordPress admin, database, FTP/SFTP and email), turn on two-factor login, remove unknown admin users and tell your host. Once the site is contained, find how the attacker got in, clean it, update everything and ask Google to review it.
Finding out your website has been hacked is stressful, and the natural reaction is to start deleting anything that looks suspicious. That often makes things worse: it destroys the evidence you need and can leave the attacker's way back in. This guide sets out what to do in the first hour, how a proper cleanup works, what to do afterwards and how to stop it happening again.
How do I know if my WordPress site has been hacked?
Common signs include:
- Spam content: pages, posts or links you didn't create, often for pharmacy, gambling or counterfeit goods. A
site:yourdomain.comsearch in Google can reveal them. - Redirects: visitors, especially on mobile or arriving from Google, are sent to another website.
- Google warnings: "This site may be hacked" under your listing in search results, or a full-page browser warning from Google Safe Browsing.
- Unknown admin users in Users, or admin emails you don't recognise.
- Host action: your hosting company suspends the account or emails about malware or abuse.
- Odd behaviour: new files, sudden slowness or outgoing spam email.
What to do in the first hour
Work through these steps in order. The aim of the first hour is to contain the problem and preserve evidence, not to fix everything.
- Don't panic-delete. Resist removing files or reinstalling straight away. You need to know what changed.
- Take a full backup or snapshot of all website files and the database, as they are now, and store it away from the server. Label it clearly as an infected copy. It is your evidence and your fallback.
- Change every password, from a device you trust: hosting control panel, all WordPress administrator accounts, the database user, FTP/SFTP and SSH accounts, and the email accounts linked to the site and domain. Use long, unique passwords.
- Turn on two-factor authentication for your hosting account, domain registrar and WordPress admin logins.
- Check users. In WordPress, review every account with Administrator or Editor rights. Remove any you don't recognise, after noting their details for your records.
- Protect visitors. If the site is redirecting people, serving malware or collecting data, put it into maintenance mode or take it offline until it is cleaned.
- Contact your host. Tell them what you have found. They may have logs, scan results or clean backups.
Could customer data have been exposed?
If the site stores personal data, such as enquiry forms, customer accounts or orders, the hack may count as a personal data breach. In the UK, the ICO's guidance under UK GDPR is that a breach likely to put people's rights and freedoms at risk must be reported to the ICO without undue delay and, where feasible, within 72 hours of becoming aware of it. Other countries have their own rules. Check your obligations early, keep a written record of what happened and when, and take professional advice if you are unsure. This guide is not legal advice.
How to clean a hacked WordPress site
- Find the entry point. Common causes are outdated plugins or themes with known vulnerabilities, "nulled" (pirated) premium themes and plugins that ship with hidden code, weak or reused passwords, and abandoned plugins nobody updates. If you don't close it, the attacker usually comes back.
- Replace WordPress core files with fresh copies of the same version from wordpress.org, keeping only
wp-config.phpand thewp-contentfolder. - Reinstall plugins and themes from their official sources rather than trusting the existing files. Delete anything unused, unknown or nulled.
- Look for unknown files, especially PHP files inside
wp-content/uploads, where they shouldn't normally be. - Clean the database: look for injected scripts in posts, pages and widgets, spam posts, unknown admin users and changed site URL settings.
- Check
.htaccessandwp-config.phpfor redirects, unfamiliar code or included files. Generate new security keys and salts inwp-config.php, which logs out every session. - Update everything: WordPress, plugins, themes and, if it is out of date, the PHP version.
- Scan again with a reputable malware scanner and check the site from a logged-out browser and a phone.
Restoring a backup can be quicker, but only if it predates the hack, and you still need to close the entry point.
What to do after the cleanup
- Ask Google to review the site. In Google Search Console, open the Security issues report. Once every listed issue is fixed, select Request Review and describe what you found and what you did. Google says reviews can take several days or weeks, and you should not resubmit while one is pending.
- Check Safe Browsing status on Google's Transparency Report site status page.
- Monitor for a few weeks: watch for new admin users, changed files, new spam pages in Google and unusual traffic.
How to stop it happening again
- Apply WordPress, plugin and theme updates promptly.
- Remove plugins and themes you don't use, and never install nulled software.
- Give each person their own account with the lowest role they need, and remove accounts when people leave.
- Use strong unique passwords and two-factor login everywhere.
- Keep automatic, off-site backups and test restoring them.
- Consider a web application firewall, either from your host, a CDN or a security plugin.
- Set up uptime and file-change monitoring.
Most of this is routine maintenance. Our guide to website maintenance costs explains what a plan should cover, and our monthly plans include updates, backups and monitoring.
Should I fix it myself or get professional help?
| Do it yourself | Professional cleanup | |
|---|---|---|
| Good fit | Simple brochure site, recent clean backup, comfortable with files and databases | Online shop, customer data, repeat hacks or Google warnings |
| Cost | Your time | A fixed or quoted fee |
| Main risk | Missing a backdoor, so the hack returns | Depends on the provider finding the entry point, not just cleaning symptoms |
| Google review | You write the request | Usually handled for you |
| Afterwards | You maintain it | Can move onto a maintenance plan |
If you'd like help, our website rescue service cleans hacked sites, closes the entry point and gets them back online. If you hold sensitive data or want to know whether other weaknesses remain, our security testing can check the site properly once it is clean.
Frequently asked questions
Should I delete my hacked WordPress site and start again?
Not straight away. Take a backup first so you can find out how the attacker got in. Rebuilding without fixing the cause, such as a vulnerable plugin or a reused password, can lead to the same hack happening again.
Will restoring a backup fix a hacked site?
It can, if the backup was taken before the hack. You still need to change passwords and close the entry point, otherwise the restored site is just as vulnerable as before.
How long does it take to remove the "This site may be hacked" warning?
After cleaning the site, request a review in the Security issues report in Google Search Console. Google says reviews can take several days or weeks, and the label is removed once the site is confirmed clean.
How did my WordPress site get hacked?
The most common causes are outdated plugins or themes with known vulnerabilities, nulled premium themes, weak or reused passwords and unused admin accounts.
Do I have to tell my customers about a hack?
It depends on what data was exposed and where you operate. Under UK GDPR, breaches that risk people's rights must be reported to the ICO within 72 hours where feasible, and high-risk breaches may need to be shared with the people affected. Check your obligations and take advice if unsure.
Website rescue & speed fix
Fixed-price proposals, a free check-up to start, and one team that builds, tests and secures it.
See the service Ask a question

