Website hacked? What to do in the first 24 hours
If your site has been hacked, the decisions you make in the first few hours decide whether it is fixed in an afternoon or takes weeks. This article explains what to do straight away, what never to do, and what to expect when you call in an expert.
Ferenc KulcsárUpdated: 30 October 2026Reading time: about 9 min
In short: the first 24 hours in 5 steps
- Write down what you see Screenshots, the time, and what changed beforehand.
- Change every password Hosting, admin, FTP, database, email, from a clean computer.
- Tell your hosting provider They can see the logs and often have backups.
- Find your backups But do not restore any of them yet.
- Find out how they got in Until you do, the infection will come back.
Are you sure it has been hacked?
Not every fault is a hack. A failed update or an expired hosting plan can also take a site down. These signs, however, almost always mean that someone has gained unauthorised access:
- The browser shows a red warning page, or Google notes under the search result that the site may have been hacked.
- On mobile, or when arriving from Google, the site redirects to a foreign page (casino, pharmacy, prize draw), but when you type the address directly, everything looks fine.
- Japanese, Chinese or pharmacy titles appear in Google under your domain. You can check this by typing into the search box: site:yourdomain.com
- An unknown administrator has appeared among the users.
- Your hosting provider emails you about suspicious files, or about mass emails being sent from your site.
- Customers complain about strange card charges or phishing emails.
- Google Ads or Meta suspends your ads because of malware.
If even one of these is true, treat the site as hacked until proven otherwise. How to check each sign yourself is explained in this article.
The first hour: do not make things worse
The instinct is to quickly get rid of anything that looks suspicious. That is exactly what causes the most damage.
The first 24 hours, step by step
1. Write down what you see, and when it started
Take screenshots of the error, the warning and the suspicious user. Note when you noticed the problem and what changed before it: an update, a new plugin, a new employee or a new external developer. Whoever fixes the site starts from this, and nothing shortens the work more.
2. Change every password, from a clean computer
Change the passwords for your hosting (cPanel, Plesk or DirectAdmin), your WordPress administrator, FTP, the database and the related email accounts. Wherever possible, turn on two-factor authentication. Delete or suspend accounts nobody uses any more, for example a former developer’s or marketer’s.
Changing passwords alone does not stop the attacker, because a hacked site almost always has a back door left in it. It does make sure that nobody gets in with the old passwords.
3. Tell your hosting provider
Your host can see the server logs, often keeps its own backups, and will notice anyway if spam is being sent from your site. It is better if they hear it from you. Ask whether they keep daily backups and how far back they go.
4. Check whether you have a backup, but do not restore it yet
Find out where your backups are and when they were made. Restoring is only safe if we know when the malware got in and the backup is older than that. If there is no backup, not everything is lost: the system can be reinstalled cleanly, and the content can usually be saved.
5. Find out how they got in
If you cannot say after the cleanup which gap the attacker used, the infection is very likely to come back. That is why the repair does not start with deleting the malware, but with finding the cause. This is what my Website doctor service is for.
Online shops: when customer data is affected
If the hacked site handles customer data (names, addresses, orders, payment details), it is no longer just a technical matter. Under the GDPR, a personal data breach must be reported to the supervisory authority (in Hungary, the NAIH) without undue delay and, where feasible, within 72 hours of becoming aware of it, unless it is unlikely to result in a risk to the people concerned.
If card details may have been at risk, notify your payment provider as well. Who exactly you have to notify, and what to include, is something to agree with a data protection specialist or a lawyer. The technical investigation (what may have leaked, and since when) gives you the basis for it.
In practice: a cracked theme in an online shop
An online shop that was infected from day one
- System
- WordPress, WooCommerce
- Technical repair
- about 4 hours
- Full recovery
- 2–3 days
The owner of an online shop was alerted by customer complaints, and at almost the same time Google put a warning on the site. The site had been built by a developer who used a cracked (“nulled”) premium theme downloaded for free. Whoever distributed the theme had hidden a back door among harmless-looking files.
A few days after the shop went live, this code created a hidden administrator account that did not appear in the user list. Through it, the attacker injected malicious code into the checkout page that sent the data customers typed in to an external server. At night, thousands of Japanese and Chinese spam pages were created in the database, so that the attackers could use the shop’s domain to push their own pages up in Google.
The technical cleanup took about 4 hours. Removal from the blacklist was approved about 24 hours after the request, and Google’s red warning disappeared after about 36 hours.
The lesson: the infection had been in the shop since day one, so restoring an earlier backup would not have helped either. Replacing the theme and a full cleanup solved it.
What does an expert do?
So you know what to expect, this is how I work on a hacked site:
- Assessment. Symptoms, timeline, the state of the backups.
- Quarantine and backup. I take the site offline for visitors and save the infected state together with the logs, so the evidence is preserved.
- Locking down access. New passwords, database, FTP and API keys, removal of suspicious administrators, logging everyone out.
- Finding the entry point. The logs show where the attack came from. I disable the vulnerable plugin or service.
- Cleanup. Clean reinstallation of the system and plugins, removing PHP files from the uploads folder, weeding out code hidden in the database and scheduled tasks.
- Hardening. Firewall, correct file permissions, two-factor authentication.
- Checks and blacklists. Tests, then a review request in Google Search Console and, where needed, with other blacklists.
- Search recovery and final report. Dealing with the spam pages, and a written summary of what happened and how to prevent it.
Details on the Website doctor page.
What to prepare when you ask for help
The work cannot start without two things:
- Your hosting login details (cPanel, Plesk, DirectAdmin or another control panel).
- A description of the symptoms: what you see, and what your visitors saw.
These are optional, but they speed up the work:
- WordPress administrator access. If you do not have it, I can create a new one from the hosting account.
- Access to your domain or DNS manager (for example Cloudflare).
- Google Search Console access, for the review after the cleanup.
- When you first noticed the problem, and what changed on the site before it.
- Emails, warnings and file lists from your hosting provider.
- The latest clean backup, if you have one.
How long does it take, and what does it cost?
For an average site, the technical repair usually takes a few hours: in my recent jobs it was between 3.5 and 8 hours. On top of that comes the review by Google and the blacklists, which can take anywhere from 24 hours to a week after the request, and nobody can speed it up.
-
Standard30 000 – 50 000 HUFBrochure and company websites, landing pages. One database, no online shop.
-
Complex60 000 – 100 000 HUFOnline shops (WooCommerce, Easy Digital Downloads), membership sites, larger databases, custom integrations, thousands of injected spam pages.
-
Custom quoteafter diagnosisServer-level infection when several sites on the hosting account are affected; WordPress Multisite; manual recovery of a damaged or deleted database without a backup; more than 100 GB of files.
Prices are indicative and in Hungarian forints; I give you the exact price after the first look. On working days I usually look at the site the same day or the next. If it cannot wait, I also offer an emergency service with a start within two hours: at weekends during the day for an extra 25 000 HUF, at night for a 100% surcharge.
What nobody can promise you
Be careful if someone guarantees any of these:
- That Google removes the warning immediately. The review depends on Google and can take from 24 hours to a week.
- That your search rankings come back. Positions lost during the infection can take weeks or months to recover.
- That all data can be recovered. If the malware deleted orders or customer data and there is no clean backup, they cannot be restored.
- That everything works the same after the updates. If closing the gap requires updating an outdated plugin or PHP version, custom features may break. Fixing those is separate development work.
- That the site will never be infected again. If other, infected sites run on the same hosting account, or old access that was never changed remains, the cleaned site can be reinfected.
Frequently asked questions
Will the attacker come back if I only delete the malware?
Very likely, yes. A hacked site almost always has a back door or an open gap left in it that the attacker used. Until it is found and closed, the cleanup is only temporary.
Is it enough to install a security plugin?
It is useful for prevention, but not enough on a site that has already been hacked. A plugin mainly checks files; it often misses code hidden in the database or in scheduled tasks, and the reason the attacker got in.
What if I have no backup?
Recovery is still possible. The system and plugins can be reinstalled cleanly, and the content can usually be saved. Anything the malware deleted or overwrote, however, cannot be brought back without a backup.
Can a Shopify or Wix site be hacked?
The platform itself hardly, but your account can be. In one of my cases, attackers got into a Shopify store through the still-active account of an external marketer who had left, because two-factor authentication was not required. They injected malicious code through Google Tag Manager and the theme, and the company’s ad account was suspended.
