Cehpoint

Website hacked? What to do next: a UK recovery guide

Website hacked? What to do next in the UK: contain it, keep evidence, clean or rebuild, change every password, report it and get search warnings removed.

A worried man with his hands on his head at a laptop in a small office

If your website has been hacked, first limit the damage: take the site offline or into maintenance mode, keep a copy of it as it is, and change the passwords for your hosting, website admin and email from a clean computer. Then find out how the attacker got in, clean or rebuild the site, report it if personal data was involved, and only reopen once the way in is closed.

This guide is for UK business owners who already know something is wrong. If you are still not sure whether you have been hacked, start with our guide on how to tell if your web server has been hacked, which covers the warning signs and the first hour on the server itself. Everything below picks up from there and takes you through recovery, reporting and getting back to normal.

What should I do first if my website has been hacked?

Stay calm and write things down. Note the time, what you saw and anything that changed recently, such as a new plugin or a new developer login. Then contain the problem: put the site into maintenance mode or ask your host to take it offline, keep a snapshot, and change key passwords from a different, clean computer.

The WordPress project's own FAQ for hacked sites starts with exactly this: stay calm, then document what you are seeing, when you noticed it and what changed recently. That note becomes your incident record. It helps whoever cleans the site, your insurer if you have cyber cover, and the ICO if you need to report a breach.

Your first actions, in order:

  1. Write down what you saw and when. Screenshots of the defaced page, the browser warning or the host's email are useful.
  2. Contain it. If visitors are being redirected to scam pages or offered malware, take the site offline or show a holding page. A short outage costs less than infecting customers.
  3. Keep a copy as it is. Ask your host for a snapshot or download a full copy of the files and database before anyone starts deleting things. The WordPress FAQ recommends taking a snapshot even of the infected site, so you have something to refer back to.
  4. Lock the doors you know about. Change the passwords for your hosting control panel, website admin accounts, the database, SFTP and the email accounts tied to the domain. Do this from a computer you trust, not one that may itself be infected.
  5. Tell your host. On shared hosting, other sites on the same server may be affected, and your host may already be acting.

Should I clean the hacked site or rebuild it from a backup?

Restore from a backup if you have a clean one from before the attack and you can close the hole that let the attacker in. Clean the live site only when no clean backup exists, and then replace every core file from an official source rather than editing infected files by hand. Either way, keep the infected copy.

The hard part is knowing when the site was last clean. Attackers often get in days or weeks before anyone notices, so the backup from last night may already contain their files. Look at the dates of changed files, new admin users and the first odd entries in your logs, then pick a backup from before the earliest sign.

Situation Best option Why
Clean backup from before the first sign of attack Restore it, then patch and change passwords Fastest route to a known good site
Backup exists but you cannot tell when the attack began Rebuild from fresh software, import content only Avoids restoring the attacker's files
No backup at all Clean in place, replacing core files from official downloads Only option, but slower and riskier
The server itself is compromised (unknown programs, new SSH keys) Build a new server, move the site across You cannot trust anything on the old one

On WordPress, the official FAQ advises replacing the wp-admin and wp-includes folders with fresh copies of the same version, using SFTP rather than the dashboard's reinstall button, because "hacks often introduce new files" that a reinstall would leave behind. It also flags .htaccess, index.php, header.php, footer.php and functions.php as files attackers commonly change. Our WordPress security checklist covers hardening once the site is clean.

Seven-step recovery flow for a hacked website: contain, keep evidence, find the way in, clean or rebuild, change passwords and keys, report, then reopen and watch
The order that avoids the two common mistakes: wiping the evidence and reopening before the way in is closed.

How do I find out how the hacker got in?

Look for the weak point, not just the damage. The most common ways in for small business sites are out-of-date software or plugins, a stolen or guessed password, a secrets file left downloadable on the web, and a hosting account shared with other people. If you skip this step, the attacker can usually walk straight back in after you clean up.

Work through these questions with whoever looks after the site:

  • Was anything out of date? Check the content management system, plugins, themes and the server's own software. Note the versions before updating, because they help explain what happened.
  • Was a password reused or weak? Check which admin accounts exist, when each last signed in, and whether anyone shared a login.
  • Could someone download your secrets? Files such as .env, .git, database dumps or zip backups sitting in the web folder can hand an attacker every password in one request.
  • Was a developer's computer involved? The WordPress FAQ warns that attacks often begin on the site owner's own computer, where malware captures admin or FTP logins. Scan the computers used to manage the site.
  • What do the web server logs show? Requests to admin pages, upload forms or unfamiliar files around the time of the first change usually point to the entry route.

If you cannot answer these questions yourself, this is the point to bring in help. The NCSC's ransomware and incident guidance recommends an NCSC-assured Cyber Incident Response provider, whatever the size of your organisation, for serious incidents.

Which passwords and keys need changing after a website hack?

Change every credential the attacker could have seen, not only the admin password. That includes hosting, database, SFTP and SSH, email, payment provider keys, and any API keys stored in configuration files. Change them again once the site is clean, in case the attacker was still watching the first time.

A practical list:

  • Hosting control panel and registrar account (the company that holds your domain name), with two-step verification turned on.
  • Website admin accounts. Remove any you do not recognise and make sure each person has their own login.
  • Database user and password, then update the site's configuration file to match.
  • SFTP, SSH keys and server user accounts. Remove keys nobody can account for.
  • Email accounts on the domain, because attackers often use them to reset other passwords.
  • Third-party keys in configuration files: payment providers, email delivery services, maps, analytics and anything else.
  • On WordPress, the secret keys and salts in wp-config.php. The official FAQ explains that replacing them signs out anyone who is still logged in.

The WordPress FAQ makes the second-round point explicitly: change passwords again after the site is clean, because the first change may have happened while the attacker still had access.

Do I need to report a hacked website in the UK?

Yes, in two situations. If personal data such as customer names, emails or orders may have been exposed, you may need to report it to the ICO, normally within 72 hours of becoming aware. If you lost money or were the victim of a crime, report it to the police through Report Fraud, or to Police Scotland.

Personal data. UK GDPR requires you to report a personal data breach that is likely to put people's rights and freedoms at risk. The ICO's personal data breach page says to notify "as soon as possible, and where feasible within 72 hours", and lets you give incomplete information first and add detail later. If you are unsure whether to report, its self-assessment tool walks you through it. Our guide to UK GDPR 72-hour breach reporting explains the clock in plain terms.

Crime and fraud. The NCSC's page on reporting scams says victims of fraud or cyber crime in England, Wales or Northern Ireland should contact Report Fraud at reportfraud.police.uk or on 0300 123 2040, and in Scotland should call Police Scotland on 101.

Not sure where to go? GOV.UK's where to report a cyber incident service, run by the NCSC, signposts you to the right place. Note that it says information you give it is not shared with the ICO, so a personal data breach still needs its own ICO report.

How do I get Google to remove the "hacked" warning?

Fix every affected page first, then use the Security Issues report in Google Search Console to request a review. Google asks you to describe the problem, what you did to fix it and the result. Reviews can take from a few days to a few weeks, so start as soon as the site is clean.

Google's Security Issues report help page is clear that partial fixes do not count: fixing only some pages "will not earn you a partial return to search results." It also asks you not to resubmit a request while one is still being reviewed. If you have not verified your site in Search Console before, do it now; Bing Webmaster Tools offers a similar view of what Bing has found.

While you wait, check that your contact form and email are working, because customers who see a warning may try to reach you.

What should I tell customers and staff?

Tell people what they need to do, honestly and briefly. If customer data may have been exposed, explain what happened, what information was involved, what you have done and what they should do, such as watching for scam emails. Staff need to know not to discuss details publicly and who is handling the incident.

Keep a simple holding statement ready for anyone who calls. If the ICO decides the breach is high risk to individuals, you must tell those people directly and without undue delay. Avoid guessing in public: it is better to say "we are still investigating" than to correct yourself later.

How do I stop my website being hacked again?

Close the way in you found, then put three habits in place: keep software updated, keep tested backups away from the server, and watch the server so you hear about the next problem in minutes rather than weeks. Most repeat hacks happen because the original weak point was never fixed.

A short checklist for the weeks after recovery:

  • Turn on automatic security updates for the server and the website software, and remove plugins and themes you do not use.
  • Use a password manager and two-step verification for every admin and hosting account.
  • Keep backups somewhere the website cannot reach or delete, and test a restore.
  • Make sure secrets files such as .env and .git cannot be downloaded from your domain.
  • Review who has access every quarter, and remove people who have left.

For the server side of this, our Linux server hardening checklist goes through each setting in order.

How can Cehpoint help after a website hack?

Cehpoint's web server security service puts a small agent on the Linux server that hosts your site. It watches sign-ins, new programs, scheduled tasks and SSH keys, reads your web server's access logs for attacks, and runs a daily outside check of your own domains for downloadable secrets files such as .env, .git or database dumps.

What it does depends on the level you choose. In Watch, it alerts you in plain words and changes nothing. In Guard, it also blocks addresses that are guessing passwords or attacking your website, stops known crypto-mining and proxy malware, and installs waiting security updates. Full adds stronger automatic steps, such as quarantining programs that run from temporary folders. It never changes your SSH settings for you; it tells you how, so you are not locked out. It is part of the wider Cehpoint Agentic SOC, and costs are on the pricing page.

Frequently asked questions

Can a hacked website be fully recovered?

Usually, yes. Most small business sites can be restored from a clean backup or rebuilt from fresh software with the original content. The harder questions are whether customer data was taken and whether the way in has been closed. Recovery is only complete when both are answered and every exposed password and key has been changed.

How long does it take to recover a hacked website?

A simple site with a clean backup can often be back online the same day. A site with no backup, or a compromised server, can take days. Getting a Google warning removed adds more time: Google says reviews can take from a few days to a few weeks after you request one in Search Console.

Should I pay someone who says they can remove the hack quickly?

Choose help carefully. Ask what they will do to find the way in, not just remove visible damage, and whether they will keep evidence. For serious incidents the NCSC recommends an NCSC-assured Cyber Incident Response provider. Be wary of anyone who contacts you out of the blue offering to fix a hack they say they have spotted.

Do I have to tell the ICO if my website was hacked?

Only if personal data was involved and the breach is likely to put people's rights and freedoms at risk. Then you should report as soon as possible and, where feasible, within 72 hours. You must record every breach internally, even ones you do not report. The ICO's self-assessment tool helps you decide.

Will changing my passwords stop the attacker?

Not on its own. Attackers often leave a back door, such as an extra admin user, a new SSH key or a hidden file, that works whatever the password. Remove those, fix the weak point that let them in, then change every password again once the site is clean.

If you want early warning next time, see how web server security monitoring works, or start with the Agentic SOC overview.

Sources checked on 2 December 2026.

See what your own servers need today.