If your site is infected
If Google detects that your site has been compromised, we'll tell you about it in Search Console (to ensure that you're notified quickly, you can have your Message Center messages forwarded to your email account). If the hacker inserted malware into your site, we'll also identify your site as infected in our search results to protect other users.
Whatever your platform or type of infection, Google recommends the following steps:1: Quarantine your site
- Take your site down immediately. It's extremely important that you take action to prevent your site from infecting others.
- Contact your web hoster. If the attack affects other sites they host, they may already be taking steps to address the problem.
- Change the passwords for all users and all accounts (for example, FTP access, administrator account, content management system authoring accounts). Check your users: It's possible that the hacker created one or more new accounts. Password guidelines.
If you have access to your server, Google recommends configuring it to return a 503 status code. Taking your site offline is better than using robots.txt to prevent it from being crawled.
Once you've locked down your site, you'll need to identify the scope and scale of the damage that's been caused. Google recommends the following steps:
- Visit the Google SafeBrowsing diagnostics page for your site (
www.example.comwith the URL of your own site) to see specific information about what Google's automatic scanners have found.
- Scan your computer using an up-to-date scanning program to identify any malicious code the hackers might have added. Be sure to scan all your content, not just text-based files, as malicious content can often be embedded in images.
- If your site has been infected with malware, check the Malware page in Search Console. (On the site dashboard, click Health and then click Malware.) This page lists sample URLs from your site that have been identified as containing malicious code. Sometimes hackers will add new URLs to your site for their nefarious purposes (for example, phishing).
- Use the URL Removal tool in Search Console to request removal of hacked pages or URLs. This will prevent the hacked pages from being served to users.
- Report phishing pages to the Google Safe Browsing team.
- Use the Fetch as Google tool in Search Console to detect malware that might be hidden from the users' browsers, but served to Google's search engine crawler.
- Review the antiphishing.org recommendations on dealing with hacked sites.
- If you have other sites, check to see if these have also been hacked.
If you have access to your server, follow these additional steps:
- Check to see if any open redirects in your site have been exploited.
- Check your .htaccess file (Apache) or other access control mechanisms depending on your website platform for any malicious changes.
- Check your server logs to see when files were hacked (bearing in mind that hackers can alter your logs). Look for suspicious activity such as failed sign-in attempts, command history (especially as root), or unknown user accounts.
Clean up your content, removing any pages that were added, any spammy content, and any suspicious code identified by virus scanners or the Malware Details tool. If you have backups of your content, consider deleting your content entirely and replacing it with your last known good backup (once you've checked to make sure it's clean and free of hacked content). You can check whether you've completely cleaned out the hacked content by using the Fetch as Google tool in Search Console.
If you have access to your server, Google recommends the following steps:
- Update any software packages to the latest version. Google recommends doing a complete reinstall of your OS from a trusted source to be sure that you've removed everything the hacker may have done. Also make sure to reinstall or update blogging platforms, content management systems, or any other type of third-party software installed.
- Once you feel confident that your site is clean, change your passwords again.
- Get your system back online. Change your server's configuration so that it no longer returns a 503 status code and perform any other necessary steps to make your site publicly available.
- If you used the URL Removal tool to request removal of any URLs that are now clean and ready to appear again in search results, use the same tool to revoke your request.
If your site was infected with malware
Once you're sure that all malicious code has been removed, you can request a malware review of your site. Google will check your site and, if no malware is detected, will remove the warning label that appears in your site's listing on the search results page.
- On the Search Console Home page, select the site you want.
- Click Health, and then click Malware.
- Click Request a review.
If the hackers put spam on your site
Once your site is completely free of spam, you can ask Google to reconsider it for inclusion in search results. This step is necessary only for spam that was detected manually--that is, by a human. If the spam on your site was detected by means of an algorithm, then Google continually scans the pages on your site and will automatically remove the label once the problems are resolved.
To find out if your site has a hacked manual action and to request reconsideration of your site in that case:
- Sign in to Search Console with your Google Account.
- Make sure you have added and verified the site you want reconsidered.
- On the Search Console Dashboard, click Search Traffic and then click Manual Actions to see all manual actions on the site. Make sure that you have resolved the issues listed on this page.
- Request reconsideration of your site.
Whether your spam problem was detected manually or algorithmically, you can expect the reconsideration process can take up to a few weeks.
Here are some resources to help clean things up and prevent reinfection of your site.
- The Google Webmaster Central blog and the Google Security blog regularly publish tips and recommendations for webmasters.
- stopbadware.org has great information, and their forums have a number of helpful and knowledgeable volunteers who may be able to help.
- The Search Console Help Forum has useful advice, information, and discussions about malware. It's a good place to get help from Googlers and from fellow webmasters.
- The site antiphishing.org has recommendations on dealing with hacked sites.