Just found out the site is hacked?
In the first hour, contain the damage, keep a copy of the evidence, and change every password before anyone deletes files. Restoring an old backup or running a cleanup plugin first can destroy the clues to how they got in and leave the door open.
The problem
A customer says your site sent them to a pharmacy page, a casino or a fake login screen. Or Google shows a warning, or the host suspended the account. Your first instinct is to make it go away: restore last week’s backup, install a cleanup plugin, delete the strange files. All three can make it worse. The infection is often older than the backup, and deleting files destroys the only record of how the attacker got in.
How to fix it
- Contain. If the site redirects visitors, shows spam or touches payment pages, put up a maintenance page or ask the host to take it offline. If checkout may be affected, tell your payment provider now.
- Preserve. Download a full copy of the files and database from the host’s control panel, plus the access logs from the last two weeks, and store them off the server. This is evidence.
- Lock out. Change the hosting, SFTP or SSH, database and every WordPress administrator password, in that order. Then the registrar, DNS, and the email accounts that receive password resets.
- In Users, delete administrators you do not recognize. Replace the security keys in
wp-config.phpso every logged-in session ends, including theirs. - Tell your host and your team. Nobody restores a backup or installs plugins yet. Hold off telling customers until you know what was touched, unless the law or a contract says sooner.
Do not restore a backup until you know it is clean. Do not delete files you do not understand.
When to stop
The first hour is yours. Stop at the cleanup itself, especially if the site takes payments or holds customer data, you cannot tell how they got in, or it has already come back once. See hacked again after a cleanup.
Or I can do it for you
You do not have to do this yourself. Send an emergency request at rescue. I move fast on emergencies and stay on it until the site is stable. If I take it, the emergency fee is credited toward follow-up work. See security and recovery or get a quote.
This happened
A small business site went down and had been taken over: several backdoors, injected code in the main WordPress configuration file, about a dozen fake plugins that were remote-control tools, and two administrator accounts nobody created. The host’s own backups were infected too, so restoring one was not an option. I cleaned it and reinstalled WordPress from checked copies. The site went down again the next day. A second, slower pass found about half a dozen more backdoors the first one missed. I never confirmed how the attackers got in, which is why I always do a second pass.