How to Tell If Your Website Has Been Hacked and What to Do
Your homepage looks normal to you, but a customer emails to say your site redirected them somewhere odd, or Google has started showing a warning next to your listing.

Your homepage looks normal to you, but a customer emails to say your site redirected them somewhere odd, or Google has started showing a warning next to your listing. If you suspect your website has been hacked, the first few hours matter, and the worst move is to start deleting files at random before you know what happened.
Most small site hacks are not targeted. They are automated scripts that scan thousands of sites for an outdated plugin or a weak password, then quietly add spam pages or redirects. That is good news in one sense: the cleanup follows a fairly predictable pattern. Here is how to confirm the problem, contain it and get back to normal.
Signs your website has been hacked
Hacks on small sites are usually designed to stay hidden from the owner, so the signs are often subtle. Look for these:
- Redirects for visitors but not for you: many infections only redirect people arriving from search engines or on mobile, and skip logged in admins. Test from your phone on mobile data, clicking through from a search result.
- Strange pages in search results: search for your domain with the site: operator. Pages in a foreign language, or about products you do not sell, are a classic sign of injected spam.
- Warnings in Search Console: a "Security issues" or "Manual actions" notice is about as clear a signal as you will get.
- Browser warnings: a full red "Deceptive site ahead" page in Chrome means your site has been flagged.
- New admin users you did not create, or existing accounts with changed email addresses.
- Unfamiliar files in your hosting file manager, especially PHP files with random names in upload or image folders.
- A sudden spike in server load or a hosting email saying your account is sending spam or has been suspended.
One of these on its own can have an innocent explanation. Two or more together usually do not.
What to do in the first hour
Work through these steps in order. Resist the urge to start fixing things before step four.
- Take a copy of the site as it is now. Download the files and export the database, even though they are infected. You may need them to work out what happened, and you do not want to lose content you later realise was clean.
- Change every password. Hosting control panel, FTP or SFTP, database, CMS admin accounts and the email account tied to your domain registrar. Use a password manager and make each one at least 16 characters.
- Turn on two factor authentication everywhere it is offered, starting with your hosting account and registrar.
- Put the site into maintenance mode or ask your host to take it offline temporarily if it is actively redirecting visitors or serving malware. A day of downtime does less damage than a week of sending customers to a scam page.
- Contact your host. Many hosts will scan your account and tell you which files are infected. Some will clean it as part of your plan.
Cleaning a hacked website
There are three realistic routes, and which one you choose depends on how good your backups are and how comfortable you are with files.
| Option | Best when | Typical cost |
|---|---|---|
| Restore a clean backup | You have a tested backup from before the hack | Free, 1 to 2 hours |
| Clean it yourself | No clean backup, small site, some technical confidence | Free, half a day or more |
| Hire a cleanup service | Business critical site or repeat infection | Around 150 to 500 dollars |
Cleaning it yourself
For a typical CMS site, the method is to replace rather than repair. Delete the core CMS files and reinstall fresh copies of the same version. Reinstall every plugin and theme from the official source rather than trying to spot changes in the old files. Remove any plugin or theme you no longer use. Then check the uploads folder for executable files such as .php, which should not be there, and review the database for unknown admin users and suspicious script tags in posts or settings.
Finally, compare your content against the copy from step one to make sure nothing legitimate went missing.
Restoring a backup is not the whole fix
The most common advice for a hacked site is simply to restore the last backup and move on. It is the fastest way back online, and I recommend it as part of the fix. But on its own it is the reason so many sites get hacked twice in a month.
A backup restores your site to the state it was in before the attacker got in. That state included whatever weakness let them in: the outdated plugin, the reused password, the abandoned admin account. Restore without closing that gap, and the same automated script will find it again, often within days. Before you restore, find the entry point. Check your hosting access logs for the date the first infected files appeared, look at which plugins were outdated at the time, and update everything immediately after restoring.
This is also why testing the restore matters before you ever need it. Our guide on backing up your website and actually testing the restore walks through a monthly routine that takes under 30 minutes.
Getting warnings removed and trust back
Once the site is clean, you need to tell search engines and browsers. In Google Search Console, open the Security issues report, confirm you have fixed the problem, and request a review. Reviews for hacked content usually take a few days. If you have not set Search Console up yet, our step by step guide to setting up Google Search Console for a new website takes about 15 minutes.
Also remove any spam pages that were indexed. If they now return a 404 or 410 status, they will drop out of results over a few weeks. You can speed that up with the Removals tool in Search Console.
If customer data could have been accessed, such as contact form submissions or account details, find out if you have a legal duty to notify people. In the UK and EU that can apply within 72 hours of discovering a breach.
Stopping it happening again
Most reinfections come down to the same handful of habits:
- Update plugins, themes and the CMS core at least every two weeks. Our article on how often you actually need to update plugins explains a sensible schedule.
- Use unique passwords and two factor authentication on every admin account.
- Give each person their own login, with the lowest role they need.
- Keep automatic daily backups stored off the server, with at least 30 days of history.
- Set up free uptime monitoring so you hear about problems quickly.
Frequently asked questions
How do I know if my website has been hacked?
Common signs include redirects to unfamiliar sites, spam pages showing up in search results, browser or Search Console security warnings, and new admin users you did not create. Check from a phone on mobile data, since many hacks hide from logged in owners. Your host can also run a malware scan.
Can a hacked website be fixed?
Yes, almost always. Most small site hacks can be cleaned by restoring a backup or reinstalling core files and plugins, then closing the original weakness. The site may need a few days for search warnings to be lifted after cleanup.
Why does my website keep getting hacked?
Usually because the original entry point was never closed. An outdated plugin, a weak or reused password, or a hidden backdoor file left behind will let attackers straight back in. Find and fix the cause, not just the symptoms.
More in Maintenance and Security
Maintenance and Security
How to Stop Spam Comments Without Killing Real Ones
The first spam comment on a site I built for a friend's bike repair shop arrived nine days after launch, before the site had a...
Maintenance and Security
How to Fix an Expired SSL Certificate on Your Website
A site I help with went dark on a Sunday morning in March. Not down, exactly.
Maintenance and Security
How to Update PHP Version Safely on a Small Website
Your hosting dashboard shows a yellow warning that your site runs on an outdated PHP version, and you are worried that trying...