Websites

Website Hacked? What to Do in the First 24 Hours

A step-by-step plan for the first 24 hours after your website is hacked: what to do first, what not to do, and how to stop it happening again.

Green computer code on a dark screen
In this article 11 sections
  1. What to do in the first hour
  2. How did my website get hacked?
  3. Hours 1–24: clean up the hacked website
  4. Option A: restore a clean backup
  5. Option B: clean the site by hand
  6. Then close the hole
  7. How do I remove the Google "This site may be hacked" warning?
  8. How much does it cost to fix a hacked website?
  9. How to stop your website being hacked again
  10. Need help right now?
  11. Sources

In short: website hacked? Don't delete anything yet. In the first hour, change your passwords, copy the site as it is, and switch on maintenance mode if visitors are being sent elsewhere. Then find how the attackers got in, clean or restore the site, close the hole and ask Google to review it. Most small business sites are cleaned within 24–72 hours.

Common signs of a hacked website: visitors are redirected to spam or betting sites, Google shows "This site may be hacked" or a red warning screen, strange pages appear in Google results, your host suspends the account, or customers report odd emails from your domain.

What to do in the first hour

  1. Stay calm and don't delete files. Deleting things now destroys the evidence you need to find how they got in.
  2. Take a full copy of the site files and database as they are now, and label it "hacked copy".
  3. Change passwords for the hosting account, website admins, FTP/SFTP, the database and your domain registrar. Turn on two-factor login everywhere it is offered.
  4. Put the site into maintenance mode if it is harming visitors (redirects, malware downloads, a fake login page).
  5. Tell your host. They often see the attack in their logs and may already have quarantined files.
  6. If you take payments or store customer data, contact your payment provider and get advice on whether you need to report it. In the UK and EU a personal data breach may need reporting within 72 hours.

How did my website get hacked?

Most small business sites are not targeted personally. Automated bots scan millions of sites for known weaknesses. The most common ways in:

  • Out-of-date software: an old plugin, theme or CMS version with a known security hole
  • Weak or reused passwords, often leaked in another company's breach (check yours on Have I Been Pwned)
  • Nulled (pirated) themes and plugins, which often ship with a backdoor already inside
  • Old admin accounts of past staff or developers that were never removed
  • An unsupported server, such as a PHP version that no longer gets security fixes

The OWASP Top 10 lists the most common web application weaknesses if your site is custom-built.

Hours 1–24: clean up the hacked website

Option A: restore a clean backup

If you have a backup from before the hack, restoring it is the fastest fix. But you must still update everything and close the hole straight away, or the same bots will be back within days. Check the backup really is clean: attackers often get in weeks before anything visible happens.

Option B: clean the site by hand

Without a clean backup, a developer compares the site against fresh copies of the CMS, theme and plugins, removes injected code and unknown files, checks the database for spam links and hidden admin users, and reviews scheduled tasks. For WordPress, the official WordPress hacked-site FAQ is a good checklist.

Then close the hole

  • Update the CMS, every plugin and theme, and the server's PHP version
  • Remove unused plugins, themes and user accounts
  • Replace any nulled software with licensed copies
  • Add a firewall and limit login attempts

How do I remove the Google "This site may be hacked" warning?

  1. Open the Security issues report in Google Search Console
  2. Check every listed issue is fixed, including spam pages that may still be in Google's index
  3. Click Request review and explain what you fixed

Reviews for hacked-site warnings usually take a few days. Google's guide Help, I'm hacked covers the full recovery process.

How much does it cost to fix a hacked website?

SituationTypical costTime
Clean backup available, small site$100–$300Same day
Manual clean-up, WordPress business site$250–$8001–3 days
Online shop or heavy infection$600–$2,000+2–5 days
Custom app with data exposedQuoted after investigationVaries

These are typical market ranges. Cleanup is almost always more expensive than a year of proper maintenance, which is why most hacked sites we see had no updates for months.

How to stop your website being hacked again

  • Monthly (or faster) updates, tested before they go live
  • Daily backups stored off the server, with restores tested
  • Two-factor login for every admin account
  • Security monitoring that alerts you within hours, not weeks
  • A yearly review of users, plugins and server versions

Our free Website Grader checks a site's security headers and common problems in about a minute.

Need help right now?

Rachyet cleans hacked websites, closes the hole and gets Google warnings removed, then keeps the site safe with website security and maintenance plans. Contact us or use the WhatsApp button on this page, and we will reply within one business day, with hacked sites handled first.

Sources

Frequently asked questions

How do I know if my website has been hacked?

Common signs are redirects to spam sites, a Google warning such as "This site may be hacked", strange pages in Google results, new admin users you did not create, or a hosting suspension notice.

Should I delete my hacked website and start again?

Usually not. Take a copy first, then restore a clean backup or clean the site. Deleting everything loses the evidence of how the attackers got in, and a rebuilt site with the same weakness gets hacked again.

How long does it take to fix a hacked website?

Most small business websites are cleaned within 24–72 hours. Removing a Google warning takes a few more days after you request a review in Search Console.

Will a hacked website hurt my Google rankings?

It can if spam pages are indexed or Google shows a warning. Rankings usually recover once the site is cleaned, spam pages are removed and Google has reviewed the site.

Written by

Rachyet team

We design, build and grow websites and digital products for ambitious businesses. Practical notes from real projects.

Want this done for your business?

Tell us what you are building. We reply within one business day with a clear plan.

Start a project

One useful idea a month

Short, practical notes on websites, ads and SEO. No spam, unsubscribe any time.