Nobody plans for this, and everyone panics. A hacked WordPress site usually announces itself through a browser warning, a spam complaint or a sudden traffic collapse. What you do in the first day decides whether this becomes an afternoon of work or a month of cleanup. So work in order, and resist the urge to start deleting files.

First moves when you find a hacked WordPress site

  • Take a copy before you touch anything. Files and database both. It is evidence, and you may need it.
  • Put the site into maintenance mode. Stop serving malware while you work.
  • Change passwords from a clean machine. Hosting, database, FTP, admin users, and the email behind them.
  • Rotate the security keys. New salts in wp-config.php log every session out immediately.
  • Tell your host. They can often see the entry point in logs you cannot read.

Clean up properly, not hopefully

Reinstall WordPress core and every plugin and theme from official sources. Do not repair infected files by hand, because attackers leave more than one door. Next, check the places people forget: unknown admin accounts, scheduled tasks, .htaccess, and any file uploaded to the media folder that ends in .php. The official WordPress recovery guide walks the same path.

Restoring a backup is faster, so restore if you have a clean one. However, restore the files and then patch immediately, otherwise you reopen the same hole within hours.

Close the door and prove you closed it

Find the entry point before you celebrate. Usually it is an outdated plugin, a reused password or an abandoned theme nobody removed. Therefore the fix is boring: update everything, delete what you do not use, and turn on two-factor authentication for every admin.

Finally, ask Google for a review in Search Console once you are clean, or the warning stays even after the malware has gone.

In short, recovery is a checklist, not a scramble. Prevention is cheaper still: work through the WordPress security checklist and get backups done properly before you need them. If you are staring at a defaced homepage right now, our team handles cleanups.