Your small business website just got hacked. The first hour, the first day and the first week
"Our website has been hacked" is one of the worst messages a small business can post. We see it more often than we'd like, and the follow-ups tell a familiar story. An owner who can't log in at all, can't find a backup,
"Our website has been hacked" is one of the worst messages a small business can post. We see it more often than we'd like, and the follow-ups tell a familiar story. An owner who can't log in at all, can't find a backup, and doesn't know who to trust to fix it. A company that rebuilt its site on a new server, yet a search engine still lists it as blocked long after the cleanup. A site that sent visitors to a casino, was cleaned, and started doing it again a week later. Someone who keeps deleting injected code from a theme file, only to find it back the next morning. A restore from backup that quietly brought the backdoor back with it.
None of these people did anything unusual. Most small sites are hit by automated attacks, not by someone who picked them out. What separates a bad weekend from a bad quarter is mostly the order you do things in.
Here's the order we'd follow, written for owners and for the freelancers or agencies they call. It's tool-agnostic. The same thinking applies to WordPress, other CMSs and most hosted setups.
The first hour: contain, don't clean
The urge is to start deleting suspicious files right away. Hold off. In the first hour, your job is to stop the damage spreading and keep evidence.
- Take a copy of the hacked site as it is. Files and database, even if they're infected. You'll need it to work out how they got in, and your host may ask for it.
- Put the site into maintenance mode or take it offline if it's sending visitors somewhere harmful or showing spam. A short outage hurts less than a browser warning that sticks around for weeks.
- Change the passwords that matter, from a clean device. Hosting account, control panel, database, FTP/SFTP, the domain registrar and the email account that receives password resets. If your computer might be the source, don't use it.
- Tell your host. Many hosts have a security team, a scanner or a clean backup you don't know about. They also need to know if your account is being used to attack others.
- Be careful who you let help. Hacked-site posts attract "recovery experts" in the replies almost instantly. Anyone who contacts you first, asks for payment in crypto, or wants your passwords in a direct message is a second problem, not a solution. Go through your host, a known agency or someone a peer can vouch for.
If you can't log in to the site at all, that's fine. Hosting or control panel access is what really matters. That's how you get the files, the database and the backups. If you can't reach the hosting account either, start with the host's account recovery, with proof of ownership ready.
The first day: find the way in before you clean
Cleaning without finding the way in is why the casino redirect comes back. The usual doors on small sites are boring:
- An outdated or abandoned plugin, theme or extension. Especially one nobody remembers installing.
- A user account that shouldn't exist. An old freelancer's admin login, a test account, an admin you don't recognise. Check every user with admin rights, not just the ones you know.
- Reused or leaked passwords, with no two-factor login on admin accounts.
- Nulled or "free premium" software downloaded from somewhere other than the vendor.
- Server-level access you've forgotten about, like an old FTP account or a file manager in the hosting panel that was shared once.
Then decide how to get back to a clean state. You have three honest options:
| Option | When it fits | The risk |
|---|---|---|
| Restore a backup from before the hack | You know roughly when it started and have a backup from before | Backups made after the break-in contain the backdoor. Older ones lose recent orders, posts or sign-ups |
| Clean the live site in place | No clean backup, lots of recent data you can't lose | Easy to miss a file. Needs someone who knows where injected code tends to hide |
| Rebuild clean, then move the content over | The site is old, heavily modified or reinfected more than once | Takes longer. You still have to check the content you move, because the database can carry injected scripts too |
Whatever you choose, reinstall core files, plugins and themes from fresh, official copies rather than trusting the ones on the server. Then close the door you found.
The first week: search engines, email and trust
This is the part people forget, and it's why "we fixed it" doesn't always feel fixed.
- Check how search engines see the site. Use the webmaster tools for each major engine, inspect a few URLs, look for spam pages in search results and request a review once you're clean. Some hacks only show spam to search crawlers, so the site looks fine to you.
- Expect lag. A blocked or flagged site can stay that way after the cleanup until a review goes through. That's frustrating, but it's normal. Keep records of what you fixed and when, because reviewers sometimes ask.
- Check your email reputation. If the hack sent spam from your domain or your contact forms, your normal email may start landing in junk. Check your domain's email authentication settings while you're there.
- Tell people if you need to. If customer data, accounts or payments could have been touched, you may have legal duties to notify people, depending on where you operate. Even when you don't, a short honest note usually lands better than silence.
- Remember that it's not always your site. Sometimes the incident belongs to a vendor: a course platform, newsletter tool or form service whose systems are sending phishing in your name. Your job then is to warn your audience and ask the vendor what happened. You can't clean what you don't host.
What turns one hack into three
- Cleaning files but never finding the way in.
- Restoring the newest backup without checking whether it was taken after the break-in.
- Changing the site password but not the hosting, database, FTP and email passwords.
- Leaving the "temporary" admin account you made for the person helping you.
- Treating the cleanup as the end, with nobody responsible for updates afterwards.
That last one matters most. A hack is often the first time a small business learns that a website needs an owner, someone who updates it, watches the backups and knows who has access. Whether that's the owner, a staff member, a freelancer or a care plan matters less than having a name next to the job.
Your turn
- If you've cleaned up a hacked small business site, what was the way in that surprised you most?
- Restore, clean in place or rebuild: what's your default, and what makes you switch?
- How do you help owners tell real help apart from the "recovery expert" replies that show up under every hacked-site post?
- After the cleanup, what single habit has actually stopped repeat hacks for the sites you look after?
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.