In short: if your website is showing pages you never wrote, sending visitors somewhere else, or carrying a “This site may be hacked” label in Google, treat it as a live problem, not a cosmetic one. Contain it first (passwords, access, a copy of the hacked site), then find how they got in, clean or rebuild from a known-good copy, and only then ask Google to review it. Doing those steps in the wrong order is a common reason the spam comes back.
Most owners don't find out from a security alert. They hear it from a customer (“your site sent me to a casino”), spot Japanese product listings under their name in Google, or see indexed pages jump in Search Console. The site often looks normal when you open it yourself. This guide covers what to do in the first hour, the first day and the following weeks.
Signs your website has been hacked
Most hacks on small business sites exploit your domain's reputation: attackers add pages selling fake brands or pills, hide links, or redirect visitors arriving from Google. Google's Security issues report help groups these as hacked content, malware and social engineering (pages that trick people into handing over passwords or downloading software).
| What you notice | What it usually means | First check |
|---|---|---|
| Pages in Google you never created, often in Japanese or with random folder names | URL injection, such as the “Japanese keyword hack” | Search site:yourdomain.com and scroll a few pages of results |
| “This site may be hacked” under your result | Google found spam added without your permission | Search Console > Security issues |
| “This site may harm your computer” or a red browser warning | Malware or harmful downloads | Security issues report and Google's Safe Browsing site status |
| Visitors from Google land on another site, but you don't when you type the address | A conditional (cloaked) redirect | Click your own result from a phone on mobile data |
| A Search Console email saying a new owner was verified | Attacker adding themselves to submit their own sitemaps | Search Console > Settings > Users and permissions |
| Admin users, plugins or files you don't recognise | Someone has, or had, a way in | Your site's user list and your hosting file manager, sorted by date |
A warning from Google's Japanese keyword hack guide: a spam URL may show you a 404 “not found” page while still serving spam to Google. That trick is called cloaking. Check suspicious pages with Search Console's URL Inspection tool and Test live URL, which shows the HTML Google actually receives, rather than trusting what your own browser shows.
If none of these apply and your site simply isn't appearing in Google, the cause is more likely indexing than hacking. Our guide to a website not showing on Google covers that.
The first hour: contain it
Don't start deleting things yet. First, lock the attacker out and keep evidence.
- Make a copy of the hacked site. Download the files (and the database, if your site has one) from your hosting panel and keep them off the server. Google's guide recommends an offline copy before removing anything.
- Change the important passwords from a clean device. Start with the email account that receives password resets, then your domain registrar, hosting account, FTP/SFTP, the website admin and the database. Use a different strong password for each, and turn on two-step verification wherever it's offered.
- Remove access you don't recognise. Check admin users on the website, extra FTP accounts in hosting, and owners in Search Console. Our guide to getting back into a locked website explains which accounts matter.
- Tell your host. Ask which files their scanner flagged and how far back their backups go.
- Decide whether to take the site offline. If visitors are being redirected to scams or shown malware, a temporary maintenance page is kinder than leaving it up. Google's quarantine guidance suggests taking a hacked site offline while you work, for example with a page that returns a 503 status.
- Write down what you saw and when. Screenshots of the spam results, the warning emails and the date you first noticed. It helps your developer and your later review request to Google.
Clean, restore or rebuild?
There are three ways back to a clean site, depending on your backups, the site's age and what it runs on.
| Option | When it fits | Watch out for |
|---|---|---|
| Restore a backup | You have a backup from before the hack started and you know roughly when that was | The hole is still there after restoring. Restore, then patch and change passwords straight away |
| Clean in place | The site is current, the hack is limited, and someone can read code and server settings | Missing one file or database row means it comes back. Slow on large sites |
| Rebuild | No trustworthy backup, years of skipped updates, abandoned plugins or theme, or repeat hacks | Keep the same URLs (or redirect them) so you don't lose the rankings you had before |
Be honest about the third row. If the site runs on a theme that hasn't been updated in years, plugins nobody maintains, and an admin password shared among three former staff, a clean-up returns you to the same weak setup. A rebuild is also a chance to drop the parts you don't use. If you rebuild, follow our website redesign checklist so the old pages redirect properly.
Step-by-step clean-up
This is the order a developer usually works in. Google's help is plain that fixing hacked content needs someone who can read code and server configuration, so bring in help if that isn't you. Ask anyone you hire to close the way in, not just remove the spam, and to give you a written summary.
- Find the way in. The usual suspects are a stolen or reused password, an out-of-date plugin, theme or CMS, or an old copy of the site left on the same hosting account. Access logs and file dates point to it.
- Replace core software with fresh copies. On a CMS such as WordPress, reinstall the core files and every plugin and theme from the official source. Delete ones you don't use.
- Check the files attackers like. Look at .htaccess (redirect rules and fake verification files), index.php, any PHP files inside the uploads folder, and files modified around the time the problem began. Google suggests sorting files by modified date and by size, and looking for jumbled code that uses functions like base64_decode, eval or gzinflate.
- Check the database, not just the files. Spam pages and hidden links often live in database tables, which is why a file scan can come back clean while the spam is still there. Search for words like “casino”, pharmacy terms or Japanese characters.
- Remove rogue sitemaps. Attackers add sitemaps so Google finds their pages quickly. Delete any you didn't create.
- Check scheduled tasks and email settings. Look for unfamiliar cron jobs in hosting, and for forwarding rules on the business mailbox that send copies of your email elsewhere.
- Test as Google, and as a visitor from Google. Run URL Inspection's live test on the spam URLs and a few real pages, and click your own search result on a phone. Spam URLs should now return a real 404 or 410 status, and real pages should show only your content.
- Close the hole and harden. Update everything, limit admin accounts and store backups away from the server. The WordPress project's own hardening guide is a good reference if your site runs on it.
Getting the spam out of Google
Once the site is genuinely clean, deal with Google.
- Request a review only when everything is fixed. Google's help says fixing the issue on just some pages won't earn a partial return, and that a request sent before the problem is fixed can slow the next review or get the site marked as a repeat offender. In the Security issues report, select Request Review and describe what was wrong, what you did and the result.
- Expect days to weeks. Google says a security review can take from a few days to a few weeks. Don't resubmit while one is pending.
- Let spam URLs return 404 or 410. Google's removal help says to make removed pages return one of those status codes. Don't redirect them all to your homepage, and don't block them in robots.txt, because Google then can't see that they're gone.
- Use the Removals tool for the worst ones. In Search Console, Removals hides a URL, or every URL starting with a prefix such as a spam folder, for about six months while Google recrawls. Google's Removals tool help says it's for blocking the hacker's URLs, not your whole site.
- Resubmit your real sitemap and check the Pages report over the following weeks. Spam URLs drop out as Google recrawls them, which takes time on large hacks.
- If there was no warning in Search Console, Google says the issue may have been detected automatically and you don't need to request a review.
You can check whether Google currently lists your site as unsafe on the Safe Browsing site status page, which works even if you've never set up Search Console.
If customer data or email was involved
Most spam hacks are after your rankings, not your customers. But if your site stores enquiries, bookings or orders, assume that data could have been seen until you know otherwise.
- Payments: if card details were entered on your own pages, contact your payment provider straight away. With a hosted checkout, card numbers usually never touch your server, but tell the provider anyway.
- Know the rules. In the US, every state has a data breach notification law, and the FTC's Data Breach Response: A Guide for Business sets out the steps. In the UK, reportable personal data breaches must be reported to the ICO within 72 hours of becoming aware of them, where feasible. Get advice rather than guessing.
- Check your email. If the attacker got into the mailbox, change that password first, review forwarding rules and connected apps and warn regular customers about unusual payment requests in your name.
An example of how this plays out
Illustration, not a real client: a bakery's five-year-old WordPress site has an abandoned theme, an unused booking plugin and one admin login shared with former staff. Search Console suddenly reports thousands of new indexed pages, and a site: search shows Japanese handbag listings, though the homepage looks fine.
Following the steps above, the owner copies the site, changes every password and finds a second admin user plus a PHP file in the uploads folder dated the week the pages appeared. The oldest backup already contains it, so they rebuild on the same URLs, make the spam URLs return 410, remove the spam folder by prefix, remove the unknown Search Console owner and then request a review.
The point isn't the specific file: the fix sticks only when every door is closed before Google is asked to look again.
Prevention checklist
None of this makes a site unhackable, but it removes the easy ways in.
| Check | How often | Why it matters |
|---|---|---|
| Unique passwords and two-step verification on email, registrar, hosting and admin | Once, then when staff change | A stolen password alone isn't enough to get in |
| CMS, plugin and theme updates | Weekly or monthly | Out-of-date software is a common way in |
| Delete unused plugins, themes, old copies of the site and test folders | Every few months | Things you've forgotten about still run, and still need patching |
| Backups stored away from the server, with one test restore | Automatic daily or weekly; test twice a year | A backup the attacker can reach, or that has never been tested, may not help |
| Search Console set up, with alerts going to an inbox someone reads | Once, then glance monthly | Google may spot the hack before you do |
| A site:yourdomain.com search for anything odd | Monthly | Catches injected pages early |
If you'd rather not run that list yourself, our guide to website care plans explains what a good plan covers.
There's also the question of how much your site needs to run. A hand-coded static site has no database, no login page on the site and no plugins, so most of the usual ways in simply don't exist. You still need to secure the hosting and domain accounts. That's one reason the small business websites we build are hand-coded.
FAQ
How do I know if my website has been hacked?
Common signs are pages in Google you never created, a “This site may be hacked” or “This site may harm your computer” label, visitors from Google being redirected elsewhere, unknown admin users or Search Console owners, and warnings from your host. Check Search Console's Security issues report and search site:yourdomain.com.
Why does my site look normal to me but show spam in Google?
Many hacks use cloaking: they show the spam only to search engines or to visitors arriving from search results. Use Search Console's URL Inspection live test to see what Google receives, and click your own search result from a phone.
How long does it take Google to remove a hacked warning?
Google says a security review can take from a few days to a few weeks after you request it. Request it only once every page is fixed, and don't resubmit while a review is pending.
Should I delete my website and start again after a hack?
Not straight away. Keep a copy first, then decide between restoring a clean backup, cleaning in place, or rebuilding. Rebuild when there's no trustworthy backup or the software is outdated and unsupported, keeping the same URLs.
Will a security plugin stop my site being hacked again?
It can help, but it won't fix a reused password, an abandoned theme or a forgotten old copy of the site on the same hosting account. Updates, two-step verification and tested off-server backups do more.
Next step
If your site keeps getting hacked or runs on software nobody updates, it may be time for a cleaner foundation. Aurel Digital builds fast, hand-coded custom websites and small business websites with fewer moving parts. We keep your existing URLs so rankings carry over, and you own the domain, hosting and code. Sites start from $300 with a fixed quote.
Not sure what you're dealing with? Send us your web address or email James at james@aureldigitals.com with what you've noticed, and we'll tell you honestly whether it looks like a clean-up or a rebuild.
Related: Is a website care plan worth it?, Locked out of your website?, Website not showing on Google?, Small business website checklist 2026
About the author: James is the founder of Aurel Digital, a remote studio founded in 2026 that builds websites, stores and apps for brands, nonprofits and service businesses. More about James and Aurel Digital.