- Checked
- 2026-11-14
Your website was hacked. Do this first.
The signs are usually loud: the site redirects to spam, search results show pages you never wrote, the host suspends the account for sending mail. The first hour decides whether you clean it once or three times.
The first hour
- Take a snapshot or a full copy of the server as it is now. You need it to find out how they got in, and deleting files first destroys that.
- Put the site in maintenance mode or block it at the firewall, so visitors are not sent on to the attacker's pages.
- From a different, clean computer, change the passwords that matter: the hosting panel, SSH keys, the CMS admin accounts, the database, and the email account those reset links go to.
- Tell whoever needs to know. If customer data may have been read, the rules on reporting it may apply to you; ask about that early, not after the clean-up.
Finding the way in
Cleaning without finding the entrance is how a site gets hacked again the following week. Look for files changed recently, find /var/www -mtime -7 -type f lists the last week's, and for PHP files in upload folders, where none belong. Read the web server's access log around the first sign of trouble for POST requests to odd addresses.
The usual entrances on small sites are an outdated plugin or theme, a reused password, and an old copy of the site left in a forgotten folder.
Clean or restore
Restoring a backup from before the break-in is fastest, but only if you know when it started and you close the entrance in the same step. Otherwise the restored site has the same hole and is taken again. Where no clean backup exists, the site is rebuilt from fresh copies of the CMS and plugins, with only the content brought across.
After the clean-up
Update everything, remove what is not used, and turn on the basics from the hardening checklist. If search engines flagged the site, ask for a review in their webmaster tools once it is clean. Watch the server for a few weeks: new files in upload folders or mail sent in bulk mean it is not over.
When to hand it over
Server Rescue covers a hacked server: one incident at a fixed $69, with a same-day start listed at $109, and nothing to pay if we cannot fix it. We look for the entrance before cleaning, change nothing destructive without a copy in front of it, and write down what was found and every step taken. It is not a forensic investigation for a court or an insurer.
Questions people ask
- Should I delete the hacked files straight away?
- Copy the server first. The files show how the attacker got in, and without that the clean site can be taken again the same way.
- Is restoring a backup enough?
- Only if the backup is from before the break-in and the way in is closed at the same time. A restore alone brings back the same hole.
- How did they get in?
- On small sites, most often an outdated plugin or theme, a reused or leaked password, or an old copy of the site left on the server. The logs and recently changed files usually show which.
- What does cleaning a hacked server cost?
- With us, Server Rescue at $69 for the incident, or $109 for a same-day start. If we cannot fix it, you pay nothing.
More server help
- Linux server hardening checklist
- WordPress white screen or critical error
- Email from the server going to spam
- Server down: what to check first
- 502 Bad Gateway on nginx
- 504 Gateway Timeout
- Error establishing a database connection
- Too many redirects
- 403 Forbidden on nginx or Apache
- Disk full: no space left on device
- SSL certificate expired: the fix
- Renewing a Let's Encrypt certificate
- DNS not resolving or still on the old server
- Moving a site to a new server
- All server help guides
