On the first day after a website is hacked, the biggest mistake is usually not the attack itself but the panicked clean-up that follows. Files are deleted in a hurry, logs are overwritten, passwords are changed from an infected laptop, and a few hours later the site is taken over again through the same back door. Recovering a hacked website in the first 24 hours depends less on deep technical knowledge than on order and discipline: stop the spread, preserve the evidence, close the way in, then return to a clean copy. This guide breaks that day into time blocks with numbered steps. For the wider picture of servers, hosting and CDN layers, see our main guide to export website technical infrastructure; here we focus only on the incident itself.
How to Tell You Have Been Hacked
Before starting the clock, separate a real breach from a configuration problem. Some signs point clearly to an attack, others may be a simple misconfiguration. If you see any of the following, starting the plan is safer than waiting:
- Search results under your site name showing unrelated products, spam titles in foreign languages, or pharmacy and gambling pages.
- Visitors being redirected to another domain, especially on mobile or when arriving from a search result.
- A browser or Search Console security warning about the site.
- An admin account you do not recognise, or an account whose permissions have been raised.
- A notice from your hosting provider about malware, bulk e-mail sending or unusual resource use.
- Recently modified PHP or JavaScript files with odd names on the server.
Leave detailed diagnosis for later hours; in the first hour the goal is not diagnosis but keeping the damage from growing.

First Hour: Stop the Spread
The four steps of the first hour depend on each other, and their order matters. Deleting files before preserving evidence makes it almost impossible to find out later how the attacker got in.
1. Record the symptoms
Take screenshots of everything you see: spam search results, the address you were redirected to, the security warning, the unknown user account. Next to each one, note the time and who noticed it. Open a simple incident log; every action from now on goes into it with a timestamp. An incident log stops the technical team from repeating each other's work, and later it is the most organised document you will have when talking to your host, insurer or legal adviser.
2. Isolate the site
The aim is to stop visitors from meeting harmful content and to stop the attacker from continuing to use the server. Depending on your hosting setup, one of these options fits:
- Put the site behind a server-level maintenance page; if that page returns a 503 status code, search engines may treat it as a temporary outage.
- Restrict access through your CDN or firewall to your team's IP addresses only.
- If other sites share the server, separate the affected account or ask your host to suspend it.
- Temporarily stop outgoing connections from the server, especially bulk e-mail.
Shutting the server down or deleting the account may be the first reflex, but it also destroys traces in memory and on disk. Cutting access is enough; wiping the machine is not the goal.
3. Name an owner and a team
One person should run the incident. That person makes decisions, keeps the log and decides who says what to the outside world. Add the person doing the technical work (in-house or from your agency), your contact at the hosting company and, if needed, a legal adviser. Running communication over phone or a separate messaging channel is safer than using company e-mail that may itself be compromised.
4. Copy the evidence
Before touching any file, take a full copy of the current state: a server or disk snapshot, an archive of the file system and a database dump. Store it away from the affected server, somewhere with restricted write access, and label it "infected - for investigation". This copy is for analysis only, never for restoring; it must not get mixed up with clean backups.
Hours 1–6: Find the Entry and the Scope
Once the spread has stopped, the second block is about understanding where the attacker came in and what they reached. A restore made without this knowledge simply carries the same hole into a fresh copy.
5. Collect and keep the logs
Download every log you can reach from the hosting panel and the server; in many hosting environments logs are deleted automatically after a while. The main logs to collect are:
- Web server access and error logs (IP, time and address of every request).
- FTP, SFTP and SSH session logs.
- Login and activity logs from the hosting or cloud panel.
- User and activity logs from the content management system, plus security plugin logs if you have one.
- CDN and firewall event logs.
- Account activity at your domain registrar and DNS provider.
When reviewing logs, start a few days before the first symptom. Admin logins from unexpected countries, POST requests to upload folders and bursts of failed login attempts are typical clues.
6. Change the credentials
Change passwords from a device you are sure is clean. If the attack started with malware on an employee's computer, a new password typed on that same computer goes straight to the attacker. Track everything that needs changing in one list:
- Hosting and cloud panel accounts.
- FTP, SFTP and SSH access; renew SSH keys and remove any you do not recognise.
- Database user passwords and the configuration files that hold them.
- Every admin account in the content management system; remove unknown accounts and end open sessions.
- API keys connected to the site: payments, e-mail sending, CRM, maps and analytics.
- Domain registrar, DNS provider and CDN accounts.
- Company mailboxes that receive the site's form notifications.
Turn on two-step verification on every account that supports it. After the restore is finished, the secret keys in configuration files need to be renewed once more; we come back to that in the hours 6–24 block.
7. Identify the entry point
On small and mid-sized company sites, the most common ways in are outdated plugins or themes, stolen admin passwords, weak FTP access and server software missing security updates. If you run WordPress, list every plugin and check its last update date and known vulnerabilities; our post on WordPress plugin risks and update management explains how to keep that inventory. If the entry point cannot be confirmed, closing the two or three most likely routes together is better than closing none.
8. Map the affected data
List the data the site holds: quote request submissions, dealer or customer accounts, newsletter subscribers, uploaded files. Try to establish from the logs whether the attacker reached the database or form records. If the answer is "personal data may have been affected", the notification section below becomes part of your first 24 hours.
Hours 6–24: Restore from a Clean Backup
The third block is about putting the site back online safely. The most common mistake here is cleaning infected files one by one and assuming the site is now clean. Hidden back doors often sit behind innocent-looking file names, which is why returning to a clean backup is the more reliable path.
9. Choose the clean backup
A clean backup must date from before the first unauthorised access, not before the first symptom. If you found the first suspicious login in the logs, pick the backup taken before it. If you do not know how often or where backups are taken, this incident is the most expensive moment to find out; we explained why a maintenance and backup routine should exist before any incident in our post on regular website maintenance and backups. Backups stored only on the same server may be affected too; off-server backups are more trustworthy.
10. Restore and close the hole
If possible, restore in a separate environment rather than on the live server, and check it there. An existing test environment makes this much easier; our post on the staging environment covers how to set one up. Follow this order during the restore:
- Replace the core software, theme and plugins with current versions freshly downloaded from official sources.
- Remove unused plugins and themes completely.
- Restore content and the database from the backup; check that upload folders contain no executable files.
- Renew the secret keys in configuration files and the database password.
- Permanently close the hole you identified as the entry point (update, permission restriction, closed access).
- Re-enter legitimate content added after the backup date (new product pages, blog posts) by hand, checking each item.
11. Verify before going live
Run a few checks before opening the site: do the home page and key product pages load correctly in every language version, is there any redirect on mobile or desktop, is there an unknown script in the source code, do the forms submit to the right address? Addresses created for spam pages should return a 404 or 410 status code after the restore; redirecting them to the home page hides the problem rather than solving it.
12. Reopen under watch
For the first hours after lifting the access restriction, watch the logs and file changes closely. File integrity monitoring, or even a simple change alert, helps you spot the same attacker trying again early. Write the time the site reopened and the final checks into the incident log.

Search Console and the Review Request
When Google detects hacked content, it may report it in the Security Issues report in Search Console; in some cases a warning may also be shown to visitors in search results or the browser. Report names, how warnings look and review times can change over time, so check the official source, Google Search Central documentation, for the current state. The general path looks like this:
- Open the Security Issues and Manual Actions reports in Search Console and note the issue types and sample URLs listed.
- Make sure the site is fully cleaned and the entry point closed; a request sent before the clean-up is finished may be rejected.
- If the report offers a review request, describe briefly and concretely what was found, how it was cleaned and how the hole was closed.
- Wait for the result; review time can vary by issue type and is not in your control.
- Remember that the attacker may have added their own account as an owner in Search Console; remove unknown accounts under users and permissions.
Spam pages drop out of search results as they are recrawled after returning 404 or 410, which can take time. Temporary removal tools can be used to shorten that period, but the lasting fix is that the addresses are truly gone on the server.
Notifying Customers and Buyers
If step eight led you to conclude that personal data may have been affected, notification stops being a public relations matter. Regulations such as KVKK in Türkiye and the GDPR for your buyers in the European Union may set duties to notify the relevant authority and the people affected after a data breach, with short deadlines for doing so. This section is not legal advice: within the first 24 hours, contact a legal adviser or your data protection officer to establish whether a duty exists, and to whom, when and with what content a notification should be made.
Even if no personal data was affected, sending a short, plain note to your key buyers protects trust. A buyer who noticed a strange redirect or suspicious e-mail from your site will read silence more negatively. If you set up a corporate status page for outages and incidents in advance, publishing the general update there is more consistent than sending e-mails one by one. Do not state uncertain things as facts in the note; saying "the investigation is ongoing" is better than a statement you will have to correct later.
The First 24 Hours at a Glance
The table below is meant as a short summary you can keep open at the side of the screen during an incident:
| Time | Steps | Mistake to avoid |
|---|---|---|
| First hour | Record symptoms, isolate the site, name an owner, copy the evidence | Deleting files at once or shutting the server down completely |
| Hours 1–6 | Collect logs, change credentials from a clean device, identify the entry point and data scope | Changing passwords from a computer that may be compromised |
| Hours 6–24 | Choose a clean backup, restore in a separate environment, close the hole, verify, reopen under watch | Cleaning infected files one by one and calling the site clean |
| In parallel | Review Search Console reports, contact a legal adviser if needed, inform buyers | Sending a review request before the clean-up is finished |
After the First 24 Hours
By the end of the first day the site is back up, but the incident is not closed. The work of the following days moves at a calmer pace:
- Watch logs and file changes closely for a week or two; repeat attempts usually come in this period.
- Turn the incident log into a short review: entry point, time to detection, steps that worked and steps that did not.
- Review backup frequency, where backups are stored and when a test restore was last carried out.
- Keep admin accounts to a minimum, remove unused plugins and access, and assign update responsibility to one named person in writing.
An incident response plan works when it is written before the incident. Ask yourself: if your site were taken over tonight, could you say within a minute where the last clean backup is and from which device you would change the passwords?




No comments yet
Leave a Comment