How to Fix a Hacked Website: Step by Step Recovery Guide
Website hacked? Follow this step by step recovery guide to confirm the hack, contain the damage, clean files, restore Google trust and stop it happening again.

Short answer: Take the site offline or into maintenance mode, change every password, find out how the attacker got in, then restore from a clean backup or remove the malicious code, patch the hole, and ask Google to review the site if it was flagged. Cleaning without closing the entry point almost always leads to reinfection within days.
First, breathe: what a hack usually is
When a small business site is hacked, it is rarely a targeted attack by someone who cares about you. It is almost always automated: bots scan millions of sites for known weaknesses, such as an outdated plugin, a weak admin password or a leaked hosting login, and exploit whichever ones they find. The goal is usually to use your site's reputation: injecting spam links, redirecting visitors to scam pages, hosting phishing pages, sending spam email or mining resources.
That matters because it tells you how to fix it. You are not fighting a mastermind. You are closing an open door that a robot found, and then cleaning up the mess it left.
Signs your site has been hacked
- Google shows "This site may be hacked" or a red "Deceptive site ahead" warning.
- Visitors on phones get redirected to adverts, prize scams or adult sites, while it looks fine on your laptop (attackers often target only mobile or only search visitors).
- Search results show your site with strange titles in other languages, pharmacy or casino terms.
- Your host suspends your account or emails you about malware or spam.
- New admin users you did not create, or files you do not recognise.
- The site is suddenly very slow, or your email starts bouncing because your domain is on a spam list.
A quick test: search Google for site:yourdomain.com and scan the results for pages you never made.
The recovery plan, step by step
1. Contain it
Put the site into maintenance mode or ask your host to take it offline temporarily. Every hour a malicious redirect stays live, more customers see it and more search engines flag you. Tell your team not to log in from unknown devices meanwhile.
2. Change every password, from a clean device
Use a computer you trust, ideally not the one you normally use for the site if you suspect it is infected. Change, in this order: your domain registrar login, hosting control panel, FTP or SFTP accounts, database passwords, every website admin account, and the email account linked to all of them. Turn on two-factor authentication everywhere it is offered. Remove admin users you do not recognise.
3. Take a snapshot before you clean
It feels odd, but back up the hacked site first. You may need to compare files, recover content added since your last good backup, or show evidence to your host.
4. Find the entry point
This is the step amateurs skip. Check your host's access logs around the time problems started. Look at which plugins, themes or software were out of date. Check for leaked passwords using a breach notification service. Common culprits on small business sites are abandoned plugins, nulled (pirated) premium themes, reused passwords and old copies of the site sitting in a forgotten folder on the server.
5. Restore or clean
If you have a clean backup from before the hack, restoring is usually fastest and safest, then immediately update everything. If not, you will need to clean manually: replace core software files with fresh copies, reinstall plugins and themes from official sources, scan the remaining files and database for injected code (look for obfuscated code, unfamiliar files in upload folders and odd scheduled tasks), and remove anything you cannot explain.
6. Patch and harden
Update everything, delete unused plugins and themes, remove old site copies, set correct file permissions, and add a web application firewall if your setup supports one. If the entry was a known vulnerability, make sure it is gone.
7. Ask Google to re-check
In Google Search Console, open the Security Issues report, confirm you have fixed the problems listed, and request a review. Reviews commonly take days, sometimes longer. If your domain landed on email blocklists, request delisting from each one once the spam has stopped.
8. Watch closely for two weeks
Reinfection is common, usually because a backdoor was missed. Check your site on mobile, your Search Console reports and your file list every few days.
Hacked right now? Do not wait it out.
Our Website Rescue service cleans up hacked, broken and slow sites and moves you onto secure hosting so it does not happen again.
DIY or call a professional?
| Situation | Reasonable to DIY | Get help |
|---|---|---|
| You have a recent clean backup and know how to restore it | Yes | If reinfected after restoring |
| Spam pages in Google, no backup | Possible with technical skill | Usually wise |
| Customer payment or personal data may have been exposed | No | Yes, and consider your legal obligations |
| Hosting account suspended | Talk to host first | If host cannot help |
| Repeated hacks | No | Yes; the root cause is still there |
If personal data may have been accessed, you may have duties to report it, for example under UK GDPR to the ICO within 72 hours in many cases, or under data breach laws in your country or state. This is general information, not legal advice; speak to a professional about your specific situation.
A worked example
Consider a family-run café in Cork with a WordPress site built six years ago. One morning a regular messages them: tapping the site link on Instagram sends her to a fake phone giveaway. On the owner's laptop, everything looks normal. That is classic conditional redirect malware: it only targets mobile visitors arriving from social or search.
They put the site in maintenance mode, change all passwords and turn on two-factor login. The logs and plugin list point to a slider plugin last updated years ago with a known vulnerability. There is no recent backup, so a developer reinstalls WordPress core and the remaining plugins from official sources, deletes the slider, removes two hidden admin users and a disguised file in the uploads folder, and cleans injected code from the database. Google review is requested and approved a few days later.
The real lesson: the hack cost them a week of lost bookings and the cleanup bill, all because of one abandoned plugin. Illustrative, but painfully typical.
Mistakes that keep sites hacked
- Deleting the obvious spam and calling it fixed. Attackers leave backdoors so they can return.
- Changing the admin password but not hosting, FTP and database passwords.
- Restoring a backup that is already infected. Check its date against when problems began.
- Using "nulled" premium themes or plugins. These often ship with malware built in.
- Relying on a security plugin alone. Once a site is compromised, the plugin itself can be disabled by the attacker.
- Ignoring it because the site "looks fine" to you. Many infections hide from logged-in admins.
Our take: prevention is mostly about architecture
We have strong feelings here. Most small business sites do not need a database, a login page and thirty plugins exposed to the internet. Every one of those is an attack surface somebody has to patch forever. That is why SiteDrum builds static sites served from Cloudflare's edge network: there is no admin login on the live site, no database to inject, no plugins to go stale. It does not make you invincible, but it removes the doors most bots try.
When should you not choose a static site? If you genuinely need user accounts, a large shop or frequent self-publishing with complex workflows, a well-maintained dynamic platform may be right; just budget for proper maintenance. For more on the difference, read static sites vs WordPress and how to protect your website from hackers.
Quick checklist
- Maintenance mode on.
- All passwords changed from a clean device; two-factor on.
- Unknown users removed.
- Snapshot of the hacked site saved.
- Entry point identified.
- Clean backup restored or files and database cleaned.
- Everything updated; unused plugins and old copies deleted.
- Google review requested in Search Console; blocklists checked.
- Monitoring for two weeks; automatic off-site backups set up.
The bottom line
Fixing a hacked website is a sequence: contain, lock down, investigate, clean, patch, and verify. The cleaning is the visible part, but closing the entry point is what stops it happening again. Then make your site harder to hack by reducing what is exposed in the first place.
Frequently asked questions
How do I know if my website has been hacked?
Look for Google warnings, unexpected redirects on mobile, strange pages in search results, new admin users or a hosting suspension notice. Search for site:yourdomain.com in Google to spot spam pages. Test on a phone from a search result, because many hacks hide from logged-in owners.
Will Google remove the hacked warning automatically?
Not usually. Once the site is clean, request a review in the Security Issues report in Google Search Console. Reviews commonly take a few days, and the warning is lifted when Google confirms the problem is gone.
Can I just restore a backup?
Yes, if the backup is from before the infection and you then close the entry point by updating software and changing passwords. Restoring without patching usually leads to reinfection. Check the backup date carefully against when problems began.
Why does my site keep getting hacked again?
Usually because a backdoor was left behind or the original weakness was never fixed. Common causes are outdated plugins, reused passwords and old site copies on the server. A thorough clean plus hardening, or a move to a simpler setup, breaks the cycle.
Do I have to report a website hack?
If personal data may have been accessed, you may have legal duties to report it to a regulator and possibly affected people, often within tight time limits. Requirements depend on your country and the data involved. This is general information, not legal advice, so get professional guidance.
Want a website that brings you customers?
Tell us what you do on WhatsApp and we will send a fixed quote and a free mockup.
Get my free mockupRelated guides
Our products
Website design near you
Website design in New YorkWebsite design in LondonWebsite design in AmsterdamWebsite design in GlasgowWebsite design in SeattleWebsite design in ManilaWebsite design in BrusselsWebsite design in DallasWebsite design in OsloWebsite design in TorontoAll cities →
SiteDrum home · All guides · Sitemap · Contact us