The short answer
A hacked website shows up as a Google warning, a red browser screen, redirects to spam, pages in your search results you never wrote, unknown admin users, or spam sent from your server. Many hacks hide from the owner, so check Search Console and run a site: search. Contain first, clean second, ask Google for a review last.
What to know
- Search Console's Security Issues report files hacked sites under three headings: hacked content, malware and unwanted software, and social engineering.
- A hack can show different content to you and to Google, and some redirects fire only on phones or only for visitors who arrive from Google.
- Take the site offline from outside the infected server before you clean anything, and change passwords from a computer you have scanned.
- A review requested before the cleanup is finished prolongs the warning. Spam reviews take up to several weeks, malware reviews a few days, phishing reviews about a day.
- A blocklist listing clears only after the source of the spam is gone. Spamhaus never charges for removal.
Something about your site looks wrong: a warning under your listing in Google, a customer who clicked your link and landed on a pharmacy ad, a Japanese page you never wrote sitting in your search results. To tell whether it has been hacked, pick the sign you saw in the finder below. It says what that sign means and what to do in the first hour. If you would rather talk it through with a person, call (425) 314-1415.
Find your cause
Has your site been hacked?
Choose what you noticed. Each answer ends in what it means and the first steps to take. Your answers stay in your browser.
What did you notice?
Pick the one that worried you first. You can run the finder again for the others.
Work through it
The first hour after a hack
Do these in order. Ticks stay in this browser.
0 of 12 done
Signs Google and your browser show you
Search Console's Security Issues report sorts what Google finds into three headings. Hacked content is anything added to your site without your permission because of a security hole. Malware and unwanted software and social engineering, which covers phishing pages, make up the other two. A green check mark at the top means nothing is flagged. A flagged site shows a count, sample URLs and the date Google first detected the problem, and the same report is where you request a review after the cleanup.
Verified owners in Search Console should also get an email when Google suspects a hack. If you never verified the site, nobody received it, so verify it today. You need it for the review request anyway. The warning itself comes in two shapes. "This site may be hacked" under a search listing marks hacked content. The full-screen block appears before the page loads: "Deceptive site ahead" for social engineering, and a separate screen for malware. Our walkthroughs for the search label and the red screen cover each cleanup in detail.
Signs you cannot see yourself
A hack is built to dodge the one person who would notice it. The site shows a different page to different visitors, which Google calls cloaking, so a spam page can look empty to you while a search engine receives spammy words and links. Redirects use the same trick. The malware switches on only for visitors arriving from Google Search, or redirects that fire only on smartphones. Four checks catch what a quick look at your homepage misses.
- Switch your phone to mobile data, search for your business in Google and tap your own listing. Repeat for the inner pages customers land on as well as the homepage.
- Type site:yourdomain.com into Google, with your own domain. It lists the pages Google has indexed, including any a hacker added. Look for URLs you did not create and snippets in Japanese or gibberish. If Google shows nothing, try another search engine.
- In Search Console, paste a suspicious address into the URL Inspection tool to see what Google received. It shows the page your browser may hide.
- In analytics, watch mobile visitors. Mobile users, and only them, suddenly spending much less time on the site is the pattern Google describes for a mobile redirect.
Google's malware guide has a technical version of the redirect test: fetch the suspect page with cURL or Wget, once plain and once with a Google referrer, and keep infected pages out of your browser. If that is not your world, the person fixing the site can run it.
Signs inside your own accounts
Open your CMS user list. In WordPress that is Users, then All Users, and the Administrator filter. A freshly created administrator and pages you did not add are both on the warning list in Google's hacked-site FAQ. Write down the names and dates before you delete anything, because they show later how the attacker worked.
Search Console keeps a user list of its own, under Settings and then Users and permissions, and hackers add themselves as owners. Google's guide to the Japanese keyword hack says a notice that someone you do not know has verified your site makes a hack a strong possibility. Remove the unknown owner and the verification token they left, which is an HTML file on the server or a rewrite rule in .htaccess.
Changed files are the third place. The same Google guides name the targets: index.php, wp-load.php, 404.php and view.php, and an .htaccess file with rewrite rules you did not write. Look for code built from base64_decode, eval or gzinflate, and give a second look to any file modified around the time the trouble began. A developer can compare your files with fresh copies of WordPress core, your theme and your plugins and show what does not belong.
| Sign | Where to check | What confirms it |
|---|---|---|
| Google label or red screen | Search Console, Security Issues | A category and sample URLs |
| Redirect to spam | Your phone on mobile data, tapping your Google listing | You land on a site you never chose |
| Pages you never wrote | site:yourdomain.com in Google, then URL Inspection | Unknown URLs, Japanese or gibberish snippets |
| Unknown admin user | CMS Users list, Search Console Users and permissions | A name and date you did not add |
| Host suspension | The host's email and billing or support area | A notice that names malware or spam |
| Spam sent from your server | Host's outbound mail log, bounce messages, check.spamhaus.org | Mail you did not send, or a listing for your domain or IP |
When the server is sending spam
Bounce messages for mail you never sent, a note from your host about outgoing volume and a blocklist entry for your domain all describe one event: something on the server is sending mail. A planted script calling PHP's mail function in a loop does it, and so does a hijacked contact form or a mailbox with a stolen password. WordPress.org's hacked-site guide describes the fallout: sites abused to send spam get their IP addresses flagged by email blocklists, and the flagged IP can be the same server that sends your real email.
Verify at the source
The From line on a spam message proves nothing, since anyone can type yours. The server's own records show where the mail started. Ask your host for the outbound mail log and the mail queue, and look for a spike of messages you did not send. On a cPanel server, mail from a script goes out as the user nobody unless PHP runs under each account's own user, which makes the log harder to trace. cPanel also has an experimental option that records the sending account as actual_sender in Exim's log, /var/log/exim_mainlog.
PHP can name the guilty script itself. Switch on mail.add_x_header, which PHP's manual lists as off by default, and every message carries an X-PHP-Originating-Script header with the script's user ID and filename. The mail.log setting records every mail() call with the script's full path, line number and To address. If you forward a bounce message to whoever is investigating, include the full headers.
Outbound mail limits decide how bad the flood gets
Hosts cap how much mail an account can send. On cPanel the Max hourly emails per domain setting defaults to Unlimited, and cPanel's documentation recommends a value that is not Unlimited. With a limit set, messages over it are queued for the next hour or discarded, depending on a second setting. A separate rule blocks a domain's outgoing mail when the share of failed or deferred messages and their count both pass thresholds. The server log then records a line such as "Domain example.com has exceeded the max defers and failures per hour (7/5 (20%)) allowed" while the message is discarded.
The limit counts every message from the domain, so real quotes and contact-form notifications sent during a flood can be discarded along with the spam. After the cleanup, ask your host what limit applies to your account and whether it can be lowered.
Blocklists and how delisting works
A blocklist is a public list of IP addresses and domains that mail servers check before they accept a message. Look up your domain and your server's IP address at check.spamhaus.org, Spamhaus's IP and Domain Reputation Checker, and it says which list holds you. Three of Spamhaus's lists matter here:
- The SBL lists IP addresses of spam sources. Removal requests come from the internet provider in charge of the address, which on shared hosting means your host, and Spamhaus always wants to know how the problem was solved.
- The XBL lists IP addresses with evidence of a compromised machine behind them. Listings expire on their own after a period once the bad behavior is no longer detected, and removal goes through the checker. An IP whose problem has not been corrected is relisted.
- The DBL lists domains with a poor reputation, subdomains included. Listings expire without intervention once the domain stops matching the criteria. Eligible domains can be submitted through the checker, though Spamhaus says using the form does not guarantee removal.
Delisting is free. Spamhaus states there is never a charge to remove a listing, and that anyone offering to remove one for a fee is running a scam. Once a removal is approved it takes effect right away, though some systems take up to 24 hours to catch up. File the request after the source is gone. A request filed while the script is still running gets you listed again.
If your mail goes to spam and no hack is behind it, why business emails land in spam covers the records.
The cleanup order
Google's recovery guides run in a fixed order, and each step makes the next one safe.
- 01Take the site offline. Stop the web server, or have your host point the domain at a static page on another server that returns a 503. A 4xx or 5xx sent by the infected site does not protect visitors, and a robots.txt disallow only blocks crawlers. Google says a temporary outage is unlikely to hurt your future ranking.
- 02Tell your host and lock the accounts. Delete accounts you did not create and change the password on everything that touches the site: CMS, FTP, database, hosting panel and email. Do it from a computer you have scanned, since attackers run trojans on administrators' computers that capture FTP and wp-admin logins.
- 03Save two copies of the infected site and label them. They are your evidence, and your fallback if the cleanup breaks something.
- 04Find the damage and the entry point. Compiling the list of damaged files is one of the longest steps in recovery. Record when the hack began, since that date decides which backups are clean, and check software versions against security advisories. Keep looking after the first find, because Google warns that several independent hacks can be in place at once.
- 05Restore or clean. A backup from before the hack, restored and patched at once, beats picking through files by hand. With no clean backup, clean the files on your damage list. A clean install beats an upgrade over the top, since leftover infected files cause reinfection, so reinstall CMS core, plugins and themes from fresh copies and delete plugins you no longer use. WordPress.org advises against the reinstall buttons inside wp-admin, because they overwrite existing files and hacks add new ones. Copy /wp-admin and /wp-includes over by SFTP instead, at the same WordPress version your site runs.
- 06Update everything and change the passwords again. Google's recovery guide asks for a final password change after the clean install. In WordPress, new secret keys in wp-config.php sign out anyone still logged in.
- 07Request the review. In Search Console, open Security Issues, choose Request a review, and describe what you removed and how you closed the hole. Spam reviews take up to several weeks, malware a few days and phishing about a day. Do not resubmit while one is pending. If Google rejects the request, the report may list more sample URLs, and the warning stays until those are cleaned.
- 08Check the blocklists. Look up the domain and the server IP at check.spamhaus.org once the source is gone, and watch Security Issues until the green check mark appears.
What keeps it from happening again
Google's list of how sites get hacked is short: weak or reused passwords, missed security updates, insecure or outdated themes and plugins, phishing, loose security policies and leaked data. The defenses match the list. Use unique, strong passwords and two-step authentication on every login. Apply updates when they ship. Vet third-party plugins and ads, and delete the ones the site no longer uses. Keep automated backups running so a clean copy always exists, and keep the computers you sign in from free of malware, since trojans on those machines capture site logins. Two of our guides go deeper: what happens when plugin updates pile up and how to back up a WordPress site yourself.
When to get help
Call when your host has suspended the account, when a review comes back rejected, when the spam returns after you cleaned it, when no backup predates the hack, or when you cannot find how they got in. Google's hacked-site guide lists hiring a professional as an option beside fixing it yourself, and a cleanup you are not comfortable doing is the time to take it. We are a web studio in Mill Creek, Washington, and emergencies get handled right away. Our maintenance plans include security patches, malware scans and daily off-site backups, which cover the missed-update and no-backup problems above. Call (425) 314-1415.
Think your site was hacked?
Call and we will go through the signs with you and tell you what to do in the first hour.
Get help from Venbit
More website guides
Every question in this series, from Fix website problems.
Symptoms & emergencies17
- What Size Should Images Be for a Website?
- Why Is My Logo Blurry on My Website? How to Fix It
- Images Not Loading on My Website? 9 Causes and Fixes
- Why Is My Website Down Right Now? How to Fix It
- Why Does My Website Say "Account Suspended"?
- Why Is My Contact Form Not Sending Emails?
- There Has Been a Critical Error on This Website: How to Fix It
- Why Is My Website Showing "Not Secure" in Chrome?
- Squarespace Site Not Showing Up on Google? How to Fix It
- Why Did Google Remove My Website From Search Results?
- Why Did My Website Traffic Suddenly Drop? Top Causes
- Why Is My Website Slow on Mobile but Fast on Desktop?
- Why Does My Website Look Broken on My Phone?
- Why Do My Website Images Look Blurry or Broken?
- How to Tell If Your Website Has Been Hacked (you are here)
- "This Site May Be Hacked": How to Remove Google's Warning
- How to Fix the "Deceptive Site Ahead" Warning
What happens if...11
- Hosting Company Shut Down? What to Do in the First 24 Hours
- How to Get Your Website Files From Your Hosting Company
- Hosting Expired and Your Website Is Down? What You Can Recover
- How to Recover a Deleted Website
- How to Move a Website to a New Host Without Downtime
- Is My Web Host Going Out of Business? Signs to Check
- What Happens If My SSL Certificate Expires?
- What Happens If My Domain Name Expires?
- What Happens If Your Web Host Goes Out of Business?
- What Happens If You Stop Paying Your Web Developer?
- Why Are My Business Emails Going to Spam?
Plans & hiring1
Ownership & switching11
- How to Find Out Who Built Your Website
- How to Find Out Who Owns a Domain Name
- Locked Out of Your Own Website? How to Get Access Back
- How to Transfer a Website to a New Developer
- Website Ownership Checklist for a Small Business
- What Is My Website Built With? How to Check in Seconds
- How to Find Out Who Hosts and Manages Your Website
- What to Do When Your Web Developer Disappears
- How to Switch Web Hosting Without Losing Your Email
- Who Is My Email Provider? How to Find Out in Two Minutes
- How to Back Up a WordPress Website Yourself
Platform-specific3
Seattle & local1
The Venbit Team
Web design & SEO, Mill Creek, WA
Venbit is a web design, SEO, and digital marketing studio in Mill Creek, Washington. Since 2011 we've designed, built, and ranked small-business websites for clients across the Puget Sound and around the country, so the numbers and advice here come from real projects, not a content mill.
Sources
- Google, Help, I think I've been hacked
- Google, How do I know if my site was hacked?
- Google, Quarantine your site
- Google, Use Search Console
- Google, Identify the vulnerability
- Google, Clean and maintain your site
- Google, Request a review
- Google, Hacked with malware
- Google, Fix the Japanese keyword hack
- Google, Fix the cloaked keywords and links hack
- Google, FAQ for hacked sites
- Google, Top ways websites get hacked by spammers
- Google Search Central, Prevent a malware infection
- Google Search Central, Social engineering (phishing and deceptive sites)
- Google Search Central Blog, Detect and get rid of unwanted sneaky mobile redirects
- Google Search Console Help, Security issues report
- Google Search Console Help, Why is my site labeled as dangerous in Google Search?
- WordPress.org, FAQ: My site was hacked
- Spamhaus, IP and Domain Reputation Checker
- Spamhaus, SBL FAQ
- Spamhaus, XBL (Exploits Blocklist)
- Spamhaus, DBL FAQ
- cPanel, How to prevent spam with mail limiting features
- cPanel, How to prevent email abuse
- PHP manual, Mail configuration (mail.add_x_header, mail.log)
