Japanese keyword hack: how to clean up the spam pages
Short answer: If Google shows pages on your site full of Japanese text you never wrote, often in odd folders like /ltjmnjp/341.html, your site has the Japanese keyword hack. It's spam injected to sell fake brand goods through your domain. Clean it in this order: lock down access, remove unknown Search Console owners, replace hacked files, clean sitemaps, find how the attackers got in, then check with Google's own tools and request a review if a warning was issued.
How to recognise it
Google's guide to this hack, published on web.dev, describes it plainly: it creates new pages with autogenerated Japanese text in randomly named directories. The pages carry affiliate links to stores selling fake brand merchandise, and they're designed to show up in Google Search under your domain.
Common signs for a small business:
- Search results for your site show Japanese titles and descriptions, even though your site is in English.
- Search Console's Performance report shows impressions for Japanese queries you've never targeted.
- You receive an email from Search Console saying a new owner was verified for your property, and you don't know who it is.
- Clicking a hacked result redirects to another site, or shows a page of gibberish.
The guide also warns of a trick: the hacked URL may show a 404 or look fine when you visit it in your browser. The attackers cloak the content, showing spam to Google and something harmless to you, so you think it's fixed when it isn't.
Confirming the damage
Use Google's own views rather than your browser.
Security Issues report. Google's guide says to start here. In Search Console, open Security & Manual Actions, then Security Issues, to see whether Google has found hacked pages and to see example URLs.
URL Inspection tool. Paste one of the suspicious URLs. The inspection shows what Google sees, which exposes cloaked content your browser won't display.
A site search. Typing site:yourdomain.co.nz into Google lists indexed pages for your domain, including hacked ones. It isn't a complete list, but it's a quick way to find examples and patterns, such as a shared folder name.
Write down the patterns you find. They'll help you search your files and later confirm the clean-up worked.
Step 1: Stop further damage
- Change passwords for hosting, FTP or SFTP, the database, the CMS admin and any accounts with admin rights. Use a password manager and turn on two-factor login where it's offered.
- Tell your hosting company. Many hosts have their own clean-up help, and they may see the attack on other sites on the same server.
- Take a full backup of the hacked site before changing anything. You may need it to work out what happened.
Step 2: Remove unknown Search Console owners
Google notes that attackers often add themselves as owners in Search Console so they can change settings like sitemaps. In Settings, open Users and permissions and remove anyone you don't recognise.
Removing the user isn't enough on its own. Ownership is proven by a verification token, often an HTML file in your site's root or, as Google points out, a rewrite rule in a .htaccess file that imitates one. Delete the attacker's verification method too, or they can simply verify again.
Step 3: Replace hacked files
Google's guide focuses on the files these attacks typically change:
.htaccess files. Hackers use them to redirect visitors or serve the spam pages. The guide's advice is to find every .htaccess file on the site and replace each with a clean, default version for your CMS. These files are often hidden, so make sure your file manager shows hidden files.
Core CMS files, themes and plugins. Reinstall the core files from the official distribution, plus fresh copies of your themes, modules and plugins. Replace rather than edit, because attackers hide code in files you wouldn't think to open.
Other suspicious files. The guide suggests listing recently changed PHP files and checking them for malicious content. Look for files in folders that shouldn't contain PHP, such as an uploads folder, and for code you don't recognise.
Step 4: Clean your sitemaps
According to Google, hackers often edit your sitemap or add new ones so their URLs get indexed faster. Check every sitemap file for links that aren't yours, delete sitemaps you didn't create, and make sure Search Console lists only your genuine sitemap.
Step 5: Find the way in
Cleaning up without fixing the cause usually means the spam comes back. Common entry points for small business sites include:
- An outdated CMS, plugin or theme with a known vulnerability.
- A plugin or theme downloaded from an unofficial source.
- Weak or reused admin passwords.
- An old copy of the site, such as a test folder, left on the same hosting account.
- Shared hosting where another site in the same account was hacked first.
Update everything, delete plugins and themes you don't use, and remove old copies of the site from the server.
Step 6: Deal with the spam URLs
Once the hacked pages are gone, they should return a 404 or 410 status. Check a handful with the URL Inspection tool to make sure the server isn't still serving cloaked content to Google.
If Search Console showed a security issue, use the Request Review option in the Security Issues report after the clean-up. If there was no warning, you don't need to request anything; Google drops the pages as it recrawls them. For a few especially visible spam URLs, the Removals tool can hide them from results temporarily while that happens.
A worked example
A hypothetical Christchurch furniture maker notices Japanese text under its domain in Google. Search Console shows a stranger as owner and lists hacked URLs under a random folder name. The owner changes every password, removes the unknown owner and their HTML verification file, replaces all .htaccess files and reinstalls WordPress core, theme and plugins. Their developer finds an abandoned staging copy of the site in the same hosting account that was months out of date, and deletes it. After a final check with URL Inspection, they request a review in the Security Issues report.
FAQ
Will this hurt my rankings permanently?
Google doesn't say there's a lasting penalty once a site is clean, but recovery takes time while it recrawls. Fixing quickly and thoroughly is the best you can do.
Can I just block the spam folder in robots.txt?
That stops Google crawling the folder, but it doesn't remove the hack or the files, and the spam can move to new folders. Clean the site instead.
Do I need a security plugin?
It can help with alerts and file checks, but it's no substitute for updates, strong logins and removing unused code.
Should I restore an old backup?
Only if you're sure it predates the hack, and you still need to fix the way in. Otherwise you restore the same weakness.
If your site is showing Japanese spam in Google and you'd like help cleaning it up properly, tell us what you're seeing.