Website hacked? What to do in the first hour
By Shayan Parsai · Published · 2 min read
Keep a copy of the files and logs, take the site offline or into maintenance mode, and change every password and key. Then find out how they got in before you restore a backup, because a restored site with the same hole can be hacked again the same way. If personal data was reached, you may have 72 hours to report it.
Lessons from this story4 points ▾
- Save the evidence firstCopy files and logs before you change anything at all. You’ll need them later to work out how the attacker got in, and when.
- Change every secretPasswords, API keys and database logins should all count as stolen, including the ones for your hosting and your email.
- Find the hole before restoringA clean backup with the same hole can get hacked the same way. Find the cause first, then restore and close it straight away.
- Check the 72-hour ruleIn the EU and UK, a breach of personal data often has to be reported within 72 hours. Write down when you found out about it.
The first hour
- Copy the site files, database and server logs somewhere safe.
- Take the site offline, or put it in maintenance mode.
- Change passwords and keys for hosting, the database, email, admin accounts and connected services. Do it from a computer you trust.
- Write down what you saw and when. You’ll need the times later.
Find out how they got in
Look for admin accounts you don’t recognise, recently changed files, new scheduled tasks and unfamiliar plugins. Attackers often leave more than one way back in, so one removed file doesn’t mean the site is clean.
WordPress sites need extra care. After the UpdraftPlus incident in October 2026, TeamUpdraft warned that malicious plugins can delete their traces when they’re removed through wp-admin, and that accounts can be hidden from the admin view. Remove files over SFTP or your host’s file manager, and check users directly in the database.
Restore, then close the hole
Use a backup from before the attack, update everything, and install the fix for the hole you found. Rank Math’s advice after its own incident in October is a good rule: restore first, run a security scan, change all credentials, and install the updated software last.
Tell the people who need to know
If personal data may have been reached, the GDPR gives you 72 hours from when you became aware to report it to your data protection authority. In Sweden that’s IMY. Customers may also need to be told.
What this means for your site
Once the site is back, it’s worth finding out what else was open. A website check shows what an attacker can still see from the outside.
Contact meSources
Latest hacks
Binance
$6.3 billionMost of it moved in about 20 minutes. It may have begun with one laptop.
Node2Shell
Node.js 22, 24, 26A flaw in the Brotli decoder inside Node.js. On CISA’s list of exploited flaws.
PHP2Shell
7 in 10 websitesTwo critical PHP flaws under active attack, CISA confirms. Patched 21 October.