Website care7 min read

Website hacked? What to do in the first hour

Website hacked? What to do in the first hour: confirm it, take the site offline, change passwords, call your host, find a clean backup, then clean up safely.

DDawnwire team
Design, web and motion studio in Dubai
Green code characters on a dark computer screen
Photo: Markus Spiske, Rawpixel (CC0)

If your website has been hacked, work in this order: confirm it really is a hack, take the site offline or into maintenance mode, change every password from a clean device, contact your host, and find your most recent clean backup. Then clean the site, close the hole the attacker used, and ask Google for a review if it flagged the site. Do not delete everything in a panic: you may need the evidence.

The first hour is about stopping the damage and protecting your customers. The full clean-up usually takes longer, and that is the part where bringing in help makes most sense.

Key takeaways

  • First confirm it is a hack, not an error or an expired domain; the fix is completely different.
  • In the first hour: put the site into maintenance mode, change every password from a clean device, and contact your host.
  • Do not just restore yesterday's backup; the attacker's way in stays open until you find and close it.
  • If Google has flagged the site, clean it fully before requesting a review in Search Console.

Signs your website has been hacked

Some hacks are obvious. Others are built to stay hidden, showing spam only to Google or only to visitors arriving from search results, so you may see nothing when you type your address in directly.

  • Visitors are redirected to spam, gambling or fake prize pages, sometimes only on phones or from Google.
  • Google results show pages you never wrote, often in another language, or the words “This site may be hacked”.
  • Browsers show a red warning such as “Deceptive site ahead”.
  • Your host has suspended the account, or emailed about malware or unusual activity.
  • There are administrator accounts, plugins or files you did not add.
  • Customers report strange emails from your domain.
  • The site is suddenly very slow, or the hosting account keeps hitting its limits.

Check from outside

Look from a phone on mobile data, and by searching for your business on Google and clicking through, not only from your own browser at the office.

Rule out what is not a hack

Plenty of alarming problems are not hacks, and treating them as one wastes the first hour.

What you seeCould beWhere to look
“There has been a critical error on this website”A plugin or PHP update, not an attackOur WordPress critical error guide
“Redirected you too many times”Conflicting redirect or SSL settingsOur too many redirects guide
Browser says the address cannot be foundAn expired domain or a DNS changeYour registrar account
A hosting company holding pageAn unpaid bill or a suspended accountYour host's emails and billing page
Odd adverts on the siteYour own ad network, or adware on your own computerCheck from another device

The two most common false alarms

Our guides to the WordPress critical error and too many redirects cover the first two step by step. If none of these fit and the signs above do, treat it as a hack.

The first 15 minutes: contain it

The aim now is to stop the damage spreading, not to fix anything yet.

  • Record what you see: take screenshots, copy any strange addresses and note the time. Your host, any specialist you hire and possibly your insurer will ask for this.
  • Put the site into maintenance mode, or ask your host to take it offline, so visitors are not exposed to malware or scams while you work.
  • If you take payments, check that checkout and payment settings have not been changed, and tell your payment provider if anything looks wrong.
  • Do not delete files, restore backups or reinstall anything yet. You need to see what happened first.

The first hour: lock the doors

Change every password that could give access to the site, from a device you trust. If a password was stolen by malware on a computer, changing it on that same computer may hand over the new one too.

First-hour access checklist

  • Change the hosting account and control panel password.
  • Change every website administrator password, not just yours.
  • Change SFTP or FTP and database passwords.
  • Change the domain registrar password.
  • Change the password of the email account that receives password resets.
  • Change passwords for payment, CRM and any connected tools with access to the site.
  • Turn on two-factor authentication everywhere it is offered.
  • Sign out all other sessions; on WordPress, changing the security keys in the configuration file logs everyone out.
  • Note, then remove, any administrator accounts you do not recognise.
Download the checklist (.txt)

Call your host

Then call or message your host. Hosts deal with hacked sites all the time: they can tell you whether the server itself is affected, may have logs showing how the attacker got in, can scan the account for malware, and often keep backups you did not know about.

Find a clean backup, but do not rush the restore

A backup from before the hack is the fastest route back. The catch is knowing which one is clean. Attackers often get in weeks before anyone notices, so yesterday's backup may carry the same malware. Find the date of the first sign of trouble, such as a new file, a new user or a spike in traffic, and choose a backup from before it.

More important still: restoring does not close the hole. If the attacker came in through an outdated plugin or a stolen password, they can walk straight back into a restored site. Restore, then immediately update everything and remove the weakness. Our 3-2-1 backup guide explains why keeping several weeks of backups matters so much here.

The clean-up, from day one

If there is no clean backup, or you need certainty, the site needs a proper clean-up. On a WordPress site this usually means:

  • Scanning files and the database with a reputable malware scanner, from your host or a security plugin.
  • Replacing WordPress core files, themes and plugins with fresh copies from their official sources.
  • Removing nulled (pirated) themes or plugins entirely; they are a common source of infection.
  • Checking for injected code in the database, the .htaccess file, scheduled tasks and the uploads folder, where PHP files should never be.
  • Updating every component and deleting anything unused.
  • Rescanning, then watching closely for several days in case anything returns.

Why this part is worth handing over

Miss one backdoor (a hidden file that lets the attacker back in) and the hack returns within days. If you are not confident, this is the stage to bring in a specialist.

If Google has flagged your site

If Google detects malware, phishing or hacked spam, it usually reports it in the Security issues report in Search Console, and searchers may see a warning beside your listing. Only once the site is fully clean, request a review from that report, explaining what you found and what you fixed. Reviews can take from a day to a few weeks, depending on the type of problem.

Hacked spam often leaves large numbers of junk pages in Google's index. Make sure they now return a 404 (not found) or 410 (gone) so they drop out over time. Our Search Console guide for beginners shows where these reports live.

If customer data may have been exposed

If the site stores customer details, such as accounts, orders or form submissions, and they may have been accessed, you may have a legal duty to report it and to tell the people affected. In the UK and EU, for example, a reportable personal data breach generally has to be reported to the data protection regulator within 72 hours of becoming aware of it. Rules differ by country and change, so speak to a qualified adviser early rather than waiting until the clean-up is finished.

Most small sites never store card details, because the payment provider handles them. If yours does, or you find changes to the checkout, contact your payment provider straight away.

After the hack: make it the last one

Once the site is clean, close the gaps that let the attacker in: our website security checklist covers logins, updates, user roles and monitoring. If you need help now, a hacked-site rescue is one of our website fix packages, starting with a backup of the site as it stands and a fixed price before work begins. Or contact us and describe what you are seeing.

Frequently asked questions

Can I fix a hacked website myself?

Sometimes. If you have a clean backup from before the hack and can identify and close the way in, such as an outdated plugin, a careful owner can recover a small site. Without a clean backup, cleaning by hand is risky, because missing one hidden backdoor means the hack returns. Many owners handle the first hour themselves and hand the clean-up to a specialist.

How did my website get hacked?

On small business sites, the usual causes are outdated plugins or themes with known security flaws, weak or reused passwords without two-factor authentication, pirated themes or plugins carrying malware, and old accounts that were never removed. Your host's logs and a malware scan often show which one it was, and knowing that is what stops it happening again.

How long does it take to recover a hacked website?

Restoring a clean backup and closing the hole can take a few hours. A full clean-up without a backup often takes a day or more, depending on the size of the site and how deep the infection goes. If Google flagged the site, its review adds anywhere from a day to a few weeks before warnings disappear.

Will a hack hurt my Google rankings?

It can, especially if Google flags the site or indexes spam pages. Warnings in search results and browsers drive visitors away, and spam pages can crowd out your real ones. Once the site is clean, the spam pages return errors and any warning is cleared after review, rankings usually recover over the following weeks.

The Dawnwire Agency Deck

Our process, what each service includes, how we price and hand over, and a selection of real client work, in one free deck.

Next step

Havesomethingworthbuilding?

Tell us what you are building. We will come back with a clear scope, a timeline and a price.