A hacked website rarely announces itself. Rankings slide, strange pages start appearing in Google, and by the time anyone notices, thousands of spam URLs can be sitting in the index under your domain. This guide explains how to recover search rankings after a website hack: how to find what was injected, how to read Google’s security issues and manual actions reports, how to clean up and request a review, and how to rebuild the authority you lost.
In brief
- A hack hurts rankings in three ways: spam pages crowd out your real content, warnings in search results and browsers stop people clicking, and Google can restrict how affected pages appear.
- Clean the whole site and close the hole the attacker used before you ask Google for a review. Google says fixing only some pages will not earn a partial return to search results.
- Recovery does not end at the review. Rankings come back fastest when the cleaned site is rebuilt on a clear structure with content worth ranking.
How a website hack damages search rankings
Google’s spam policies define hacked content as “any content placed on a site without permission, due to vulnerabilities in a site’s security.” Most hacks that affect SEO fall into four patterns:
- Code injection: malicious code, usually JavaScript or iframes, added to pages you already have.
- Page injection: new pages full of spam, often thousands of them, created in folders you never made. Your existing pages can look completely normal.
- Content injection: hidden links or text added to real pages, sometimes cloaked so only search engines see them.
- Redirects: code that sends some visitors to spammy or harmful sites, often depending on the referrer, browser or device.
The ranking damage comes from several directions at once. Googlebot spends its visits on junk instead of the pages you want ranked, your domain starts to look relevant to topics you have nothing to do with, and the injected pages usually link out to the attacker’s own network. On top of that, Google can show a “This site may be hacked” label in results, Chrome can show a warning page before anyone reaches you, and some pages can be left out of results entirely. Even where your positions hold, fewer people click.
Signs your website has been hacked
Many site owners find out from a customer or a sudden drop in enquiries. These are the earlier warning signs worth checking:
- A site: search for your domain shows pages in a language you do not publish in, or topics you have never written about.
- The Performance report in Search Console shows impressions for queries that have nothing to do with your business, or the number of indexed pages jumps without explanation.
- Sitemaps you did not create, or unfamiliar URLs inside the sitemap you did create.
- Owners or users in Search Console you do not recognise. Google’s own clean-up guide for the Japanese keyword hack notes that attackers often verify themselves as owners so they can change settings such as sitemaps.
- Visitors on mobile, or arriving from Google, report being redirected elsewhere, even though the site looks fine when you type the address in yourself.
- An email from Search Console, or an entry in the Security issues report.
Do not treat your own browser as proof that the site is clean. Hacked pages are often cloaked, showing spam only to Googlebot or only to visitors from search. Google’s Security issues report documentation recommends the URL Inspection tool, or command-line tools such as cURL or Wget that can mimic different user agents and referrers, and warns against opening infected pages in a browser because malware can exploit browser vulnerabilities.
Security issues and manual actions in Search Console
Search Console has two reports that matter after a hack, and they cover different things.
| Report | What it covers | Typical entries |
|---|---|---|
| Security issues | Signs the site has been hacked or behaves in ways that could harm visitors | Hacked: malware, code injection, content injection, URL injection; deceptive pages; harmful downloads |
| Manual actions | Pages a human reviewer at Google has found to break the spam policies | Site abused with third-party spam, user-generated spam, cloaking and sneaky redirects, hidden text and keyword stuffing, unnatural links |
A hack that injects spam pages typically shows up in the Security issues report. If attackers have filled comment sections, forums or internal search pages with spam, you may also see a manual action for third-party or user-generated spam. The fix is the same in principle: resolve every listed issue across the whole site, then select Request Review in the relevant report.
Two cautions. First, the sample URLs Google shows are not a complete list, so use them as a starting point, not a to-do list. Second, an empty report does not mean you are in the clear. Google says it detects spam “through automated systems and, as needed, human review,” so a site can lose visibility to automated systems with no message at all.
How to clean up a hacked website
A thorough clean-up follows a set order. Skipping steps is the most common reason sites get reinfected and reviews fail.
- Take a copy first. Make an offline backup of the files and database before you delete anything. You will need it to work out how the attacker got in.
- Find the entry point. Outdated CMS core files, abandoned plugins and themes, weak or reused passwords, old admin accounts and insecure hosting are the usual suspects. Google is blunt that if you do not fix the vulnerability, the site is likely to be reinfected.
- Replace rather than patch. Reinstall the CMS core, plugins and themes from trusted sources. Replace .htaccess and other server configuration files with clean versions, since attackers often hide redirect and cloaking rules there. Look for recently modified files and obfuscated PHP.
- Clean the database. Injected links and scripts often live in post content, settings tables and widget areas. Check the user table for administrator accounts nobody recognises.
- Remove the spam URLs. Pages the attacker created should return a 404 or 410 status code once they are deleted.
- Clean up Search Console. Remove any owner you do not recognise, then delete every verification token they used. Google’s permissions guidance warns that if the tokens stay, the removed owner can re-verify. Delete any sitemaps the attacker submitted.
- Lock the doors. Change every password: hosting, CMS, database, SFTP, domain registrar and DNS. Turn on two-step verification and remove accounts that no longer need access.
For complex attacks, Google recommends bringing in a professional. If the site is actively serving malware, taking it offline while you clean it is the safer choice for your visitors and your reputation.
Removing hacked pages from Google’s index
Deleting spam pages from your server does not remove them from Google straight away. A few things speed the process up:
- Return the right status code. A 404 or 410 tells Google the page is gone. Avoid redirecting thousands of spam URLs to your home page, which muddies the signal.
- Use the Removals tool for the worst offenders. The Removals tool hides URLs from results quickly, but Google states a successful request “lasts only about six months.” It is a stopgap while the clean-up takes effect, not the fix itself.
- Do not block spam URLs in robots.txt. Google needs to recrawl those URLs to see they are gone. Blocking them can keep them in the index longer.
- Resubmit a clean sitemap containing only your real pages, and use URL Inspection to request recrawling of your most important pages.
Track progress with a site: search and the Page indexing report. The count of indexed spam URLs should fall steadily over the following weeks.
Requesting a review after a website hack
Only request a review when the entire site is clean. Google’s advice is plain: “Be sure that the problem is truly fixed before requesting a review.” Submitting too early can delay later reviews, and Google says it can lead to a site being treated as a repeat offender.
A strong request explains three things: the exact issue, the steps you took to fix it, and the outcome. In practice that means naming the vulnerability, describing the files and accounts you replaced or removed, stating how many spam URLs now return 404 or 410, and listing the security changes you made so it does not happen again.
Set expectations on timing. According to Google, reviews for malware usually take a few days, while reviews for sites hacked with spam may take up to several weeks because they can involve manual investigation. Do not resubmit while a request is pending. Once Google confirms the site is clean, warnings are normally removed within a few days.
Rebuilding search rankings after a website hack
A successful review removes the warnings. It does not automatically put your pages back where they were. If the hack ran for months, Google has been crawling junk, links have pointed at spam, and your real pages have been losing ground. Recovery from here is ordinary, disciplined SEO work, done with more urgency.
Fix the foundations
Run a full technical audit once the site is clean. Clean-ups often leave broken templates, missing pages, redirect loops and internal links pointing at deleted URLs. Make sure every page you want ranked is crawlable, indexable, fast and linked from somewhere sensible.
Restructure around how people search
A hack is often the moment to fix a structure that was never working. Group pages into clear topic hubs, with a strong parent page for each service or category and supporting pages linked beneath it. Our guide to pillar and cluster content strategy explains how to plan this from real search demand.
Rewrite the pages that earn money
Your highest-value pages deserve fresh, specific copy that answers what searchers want better than competitors do. Thin or outdated pages that survived the hack will not win back positions on their own.
Cover the gap with paid search
Organic recovery takes time. A focused Google Ads campaign on your core commercial terms keeps enquiries coming in while rankings rebuild, and the search terms data tells you which pages to prioritise.
How 28K approached the ISCD recovery
The International School of Colour and Design (ISCD) came to 28K with a website that had been hit by spam and hacking and was not ranking. The school was relying on agents for student recruitment, and search was contributing very little.
We started by cleaning up the spam and the damage from the hack. We then rebuilt it with content siloing and a hub and spoke architecture, so every course and course category had a clear home and a clear place in the internal linking. With the foundations fixed, we began ongoing SEO alongside Google Ads.
ISCD now ranks at the top for its courses and categories, including searches such as interior design courses, interior decoration courses and short courses, and its traffic has grown more than 1,000%. The bigger change was commercial: with search delivering, the school moved from an agent-led model to recruiting students directly.
The lesson we take from it: the clean-up removes the penalty, but the rebuild is what brings rankings back.
Keeping your site from being hacked again
Sites that have been hacked once are prime targets for a second attempt. A few habits close most of the gaps:
- Keep the CMS, plugins and themes updated, and delete anything you no longer use.
- Give every person their own login with the lowest level of access they need, and remove access when staff or suppliers leave.
- Use unique passwords and two-step verification on hosting, CMS, registrar and Search Console.
- Keep off-site backups and test that you can actually restore them.
- Turn on Search Console email notifications and check a site: search for your domain every month.
Security is part of SEO. A well-built, well-maintained site is harder to break into and quicker to recover, which is why hosting, updates and monitoring belong in the plan for any website build from day one, not as an afterthought.
If your rankings have dropped and you suspect spam or a hack, or you have already cleaned up and the traffic has not come back, talk to 28K. Our SEO team can diagnose what happened, handle the clean-up and review, and plan the rebuild.
