
Discovering a hacked website is stressful, but a calm and ordered response makes recovery faster and reduces the chance of repeat damage. This guide covers how to recognize a compromise, what to do in the first hour, how to clean up safely, and how to prevent it from happening again.
Some of these can have innocent causes, such as a misconfigured plugin, so treat them as warning signs and investigate rather than assuming the worst.
Before changing anything, record what you see. Take screenshots, note dates and times, and download copies of the server logs. This evidence helps your host or a security professional work out how the attacker got in. Avoid deleting files in a hurry, because you may erase clues, or remove things your site legitimately needs.
Attackers often return through the same credentials. Change passwords for:
Use unique, long passwords and enable two-factor authentication wherever possible. Delete administrator accounts that you do not recognize.
Your host can often see activity that you cannot, such as which account was used or whether other sites on the account are affected. They may also have scanning tools or recent server-side backups. Contact them early.
There are two main approaches.
This is often the safest route. Choose a backup from before the compromise, which you can estimate using the evidence from Step 1. Restore it, then immediately apply all updates and change credentials again. If you do not have a trustworthy backup, our guide on keeping website backups useful and restorable will help you build one for the future.
If no clean backup exists, cleaning is possible but requires care. Compare core files with fresh official copies, remove unknown files, inspect themes and plugins, and examine the database for injected content. This is time-consuming and easy to get wrong, so consider asking a security specialist.
Do not ignore permissions while you work. Overly permissive settings help attackers write files, and our article on file permissions and ownership shows what to check.
A restored site will be hacked again if the original weakness remains. Common entry points include:
Review the logs for suspicious requests, using our guide on reading a website error log to get started.
Once you are confident the site is clean, request a review through Google Search Console if your site was flagged. Remove any spam pages and make sure your sitemap lists only legitimate URLs.
Usually not. Restoring from a clean backup or cleaning the site is normally possible. Deleting everything without saving evidence or backups can make recovery harder.
The most common causes are outdated software, weak or stolen passwords, vulnerable plugins, and insecure permissions. Logs and your host can help identify the specific route.
Simple cases may be manageable, particularly with a clean backup. For complex infections or sensitive data, a security professional is a safer choice.
Need hosting that makes this easier? Explore GaugeHosting web hosting plans and get a setup built for reliable, well-supported websites.