How to Detect Hacked Site Link Placement Before Google Does

Hackers inject spam links into sites and hide them from the owner with cloaking, so the site looks fine while Google indexes casino and pharmacy pages. These checks find the injected links before they cost rankings.
Quick answer: Detect hacked site link placement by searching Google for your own domain, checking the Security Issues report in Search Console, and inspecting your sitemap for pages you never published. Hackers hide injected links with cloaking, so your browser shows a clean site while Google sees spam pages for casinos, pharmacies, and counterfeit goods.
TL;DR: Trust what Google sees, not what your browser shows. Run a site search, open Search Console, and compare the page as Google fetched it.
Key takeaways
- Hacked content means content placed on a site without permission, and Google lists three forms: code injection into existing pages, page injection of whole new spam pages, and content injection of hidden text and links, according to Google's spam policies.
- A site search is the fastest first check: odd Japanese results, product names you do not sell, and URLs in folders you did not create all point to a hack, according to a 2026 cleanup guide.
- Cloaking is the reason the hack stays hidden: the attacker serves spam to crawlers and search visitors while showing you the real site, according to Google's spam policies.
- Search Console may warn that someone you do not know has verified your site, because attackers add themselves as owners to keep the spam indexed.
- Do not block spam URLs in robots.txt. Let them return a 404 or 410 so Google drops them, according to a 2026 cleanup guide.
The four ways hackers place links on your site
Hackers use four variants, and each one hides differently. The Japanese keyword hack generates new pages full of auto-generated Japanese text under random directory names, monetized with affiliate links to stores selling counterfeit brand goods, according to a 2026 guide from CleanTalk. You usually never see these pages unless you search for them.
The pharma hack injects links and pages for pharmacies and pills into a real site, often inside existing pages where the owner rarely looks. The links point to shops that pay the attacker for each sale or click.
Cloaking is the technique that hides the other three. Google's spam policies state that when a site is hacked, it is not uncommon for the hacker to use cloaking to make the hack harder for the owner to detect. The server checks who is asking and serves spam only to crawlers and search visitors.
Search-only redirects complete the set. A visitor who types your URL sees your normal site, while a visitor who clicks through from Google is sent to a casino or a shop. That is why the hack can run for weeks before anyone reports it.
Check one: search Google for your own domain
Open Google and type site:yourdomain.com, then page through the results. Look for titles in languages you do not publish, product names you do not sell, and URLs in directories you did not create, according to the CleanTalk 2026 guide.
Narrow the search with words the spam uses. Try site:yourdomain.com casino, site:yourdomain.com viagra, or a Japanese term such as site:yourdomain.com通販, which means mail order, according to a 2026 fix guide. Result counts on site searches are rough estimates, so use them to find the URL pattern, not to count pages.
One Japanese result that fits the pattern is enough to treat the whole site as compromised. The spam pages advertise counterfeit watches, designer bags, sneakers, and pharmaceuticals, with links to affiliate shops the attacker is paid to push, according to a 2026 cleanup guide from SiteGuarding.
Check two: Search Console and URL Inspection
Open Search Console and check the Security Issues report first. New spam pages match Google's "Hacked: URL injection" label, which Google defines as a hacker creating new pages on your site, often containing spammy words or links, according to a 2026 fix guide.
Check the Performance report next. Look in the Queries and Pages tabs for Japanese text or folders you do not recognize. A sudden wave of queries for products you never sold is a strong signal.
Then check the owners list. Google's help is blunt: if you have found an owner that you do not recognize, you might have been hacked. Attackers add themselves as owners, often through a rewrite rule in .htaccess that fakes the verification file, according to the CleanTalk 2026 guide.
Finally, use URL Inspection on a spam URL to view the page as Google fetched it. Google itself recommends this because many hacks change what only Google's crawler sees. Your browser shows the clean site; URL Inspection shows the spam.
Check three: sitemaps, redirects, and server files
Open your sitemap files and look for URLs you never published. Hackers often modify your sitemap or add new sitemaps to get their URLs indexed more quickly, according to Google's own guide for the Japanese keyword hack.
Test the site the way a search visitor sees it. Open your site from a Google result in a private window, then repeat on a phone and on a different network. A referrer-based redirect only appears when the visit comes from search, according to the CleanTalk 2026 guide.
Compare responses directly. Request the same page as a regular browser, as a crawler, and as a visitor coming from Google, then compare the results. A page that returns different links for a crawler user agent than for a normal browser is cloaked.
Look at the server files last. The spam is usually generated on the fly by one small script, not stored as thousands of real pages, according to SiteGuarding's 2026 guide. The script checks the user agent, the referrer, the IP address, and whether a login cookie is present, and it serves spam only to crawlers and search traffic. Administrators never see anything wrong.
Which check finds which hack
Each check catches a different variant, so run all four before you decide the site is clean.
| Check | What it finds | Time needed | Tool |
|---|---|---|---|
| Site search | New spam pages and foreign-language titles | About 5 minutes | Google search |
| Security Issues report | Injected pages Google has flagged | About 2 minutes | Search Console |
| URL Inspection | What Googlebot actually sees on a page | About 2 minutes per URL | Search Console |
| Sitemap review | Spam URLs the hacker wants indexed | About 5 minutes | Browser and sitemap file |
What to do when you find injected links
Contain the site first. Back up what is clean, change every password, and remove unknown Search Console owners and their tokens, according to a 2026 fix guide. Deleting the visible pages does nothing if the generator script and the backdoor stay in place, because the spam returns within hours.
Remove the generator, the backdoor, and the stolen credentials before you touch Google. Then make the spam URLs return a 404 or 410. Do not block them in robots.txt, because blocking keeps them indexed longer, according to SiteGuarding's 2026 guide.
Use Search Console Removals as a temporary stopgap while Google re-crawls. Deindexing takes days to weeks, and ranking recovery can take weeks to months, according to the same 2026 guide.
File a reconsideration request only if Search Console shows a manual action, and only after the site is verifiably clean. Google says reviews take a few days to a few weeks, according to a 2026 fix guide.
Google's guide for the Japanese keyword hack describes pages in random folders such as ltjmnjp/341.html, monetized with affiliate links to stores selling fake brand merchandise and shown in Google Search. A 2026 cleanup guide adds that reviews after a fix take a few days to a few weeks, and that ranking recovery can take weeks to months. Source: Google, Fix the Japanese keyword hack (2026), and SiteGuarding, Japanese Keyword Hack (2026).
Frequently Asked Questions
How do I know if my site has hacked links?
Run a site search for your domain and look for pages, languages, or products you never published. Then check the Security Issues report in Search Console and inspect your sitemap. If any of those show content you did not create, treat the site as hacked.
Why does my site look fine but Google shows spam pages?
Cloaking. The hack serves spam to crawlers and search visitors while showing you the real site. Your browser is the least reliable way to check, so use URL Inspection in Search Console to see the page as Google fetched it.
What is the Japanese keyword hack?
It is a hack that creates auto-generated Japanese text pages on your site, usually in random folders, monetized with affiliate links to stores selling counterfeit goods. The pages are shown in Google Search even though you never wrote them.
Should I block hacked URLs in robots.txt?
No. Blocking them in robots.txt keeps them indexed longer because Google cannot see that they are gone. Let the spam URLs return a 404 or 410, then use Search Console Removals as a short-term measure.
How long does recovery take after cleaning a hacked site?
Deindexing of the spam URLs takes days to weeks, and ranking recovery can take weeks to months. File a reconsideration request only when Search Console shows a manual action and the site is verifiably clean.
Can hacked links cause a Google penalty?
Yes. Hacked content is a spam policy violation, and Google may show a warning under your results or apply a manual action. Clean the site, remove the backdoor, and request a review before the damage spreads to your real pages.
Expert verdict
Best for: site owners and agencies who run a monthly security check with site searches and Search Console, so a hack is caught in days instead of months.
Not for: anyone who only checks the site in a browser, because cloaking makes that check useless.
Pros: the checks are free and take about ten minutes; Search Console shows exactly what Google sees; early detection limits ranking damage.
Cons: cleaning needs server access and password resets; recovery takes weeks; a missed backdoor brings the spam back within hours.
If a hack has already hurt your rankings, read how to recover from a link penalty for the full cleanup sequence.
The signs of a Google link penalty guide helps you tell a hack from a normal ranking drop.
When spammy links point at your site, the Google disavow tool overview explains when disavowing helps and when it does not.
For the official report, see what is a Google manual action for unnatural links.
A quick how to check spam score pass shows whether the injected links changed your site's spam profile.
Bottom line
Search your own domain, check Search Console, and inspect your sitemap every month. When you find injected links, remove the generator and the backdoor first, serve 404 or 410 on the spam URLs, and let Google re-crawl before you ask for a review.
Sources
The BacklinkPrice Team researches backlink prices, publisher sites and link building tools. We check prices and plans against each provider's own pages and date them, so you know how current the numbers are.
More from BacklinkPrice TeamRelated guides





