Last updated: · By Asael Dreyer
In short: the Japanese keyword hack creates thousands of automatically generated Japanese-language pages on your site that sell fake products, and it sometimes hides them from you and shows them only to Google. You clean it up in three steps: remove foreign owners in Search Console, replace .htaccess and reinstall clean files, then return 404 or 410 for the spam pages and request removal. According to Google, about 20% of hacked sites get hacked again within a day (as of 7 Nov 2026).
⏱ Time needed: 3–8 hours, plus weeks until the index clears · Difficulty: advanced · Last checked: 7 Nov 2026
What is the Japanese keyword hack, and how do you spot it?
It is a hack where the attacker adds new pages to your site with Japanese text and links to fake online stores. The pages sit at randomly named URLs, and the goal is to borrow the trust Google gives your domain.
The common signs:
- A Google search for
site:yourdomain.comshows results in Japanese, or thousands of URLs you never created. - In Search Console, in the Pages report, the number of indexed pages suddenly jumped.
- An unfamiliar user appears in the owners list of your property in Search Console. According to Google’s guide on web.dev, this is a strong sign of a hack.
- When you open a suspicious URL, you get a 404 or a normal page. That does not mean the site is clean: the attacker uses cloaking, showing Google different content from what you see.
To see what Google sees, paste a suspicious URL into the Search Console URL Inspection tool and run a live test. If Google sees Japanese text and you don’t, that is cloaking.
How do you clean a Japanese keyword hack from a WordPress site?
The order matters. If you delete pages before closing the attacker’s access, they come back.
- Back up everything: files and database, including the infected state. See backup and restore.
- Remove foreign owners in Search Console: under Settings > Users and permissions. Then delete their verification file (an HTML file named google…html) or the .htaccess rule that generates it. That URL should return 404.
- Replace .htaccess: put in a clean WordPress version. Attackers add redirect rules there that serve spam only to Google.
- Reinstall core, theme and plugins from clean files. According to Google, the files that usually get hit are index.php, wp-load.php, 404.php and view.php.
- Look for hidden code: PHP files that don’t belong to WordPress, recently modified files, and code using base64_decode, eval or gzinflate.
- Check scheduled tasks: many hacks install a cron job that restores the files. On Cloudways, this is on the Cron jobs screen.
- Clean the sitemaps: delete any sitemap you didn’t create, and remove spam URLs from existing ones.
- Change passwords for all WordPress users, SFTP and the database, and turn on two-factor authentication.
On Cloudways, the Malware Protection add-on also scans the WordPress database and, according to the add-on page, cleans malicious cron jobs and redirects hidden in tables. It doesn’t replace the steps above, but it saves a lot of manual searching.
The code BFCM802 takes 80% off your bill for the first two months (up to $200 off per month), including unlimited free site migrations. New customers only, and only until the offer ends.
The offer ends on December 4, 2026 at 23:59 (UTC+2).
Start with a free trial, no credit card. Enter the code at checkout and check that it shows up.
After Black Friday: 30% off for 3 months with the code ASAEL. On a large server (above about $444 a month) ASAEL already saves more today. BFCM802 vs. ASAEL calculator
Start a free trial server, no credit card. When you move to a paid plan, the code ASAEL takes 30% off your bill for the first three months.
The link fills in the code on the signup form. Just make sure it shows up.
What do you do about the thousands of spam pages already in the index?
You let them disappear in a way Google understands: the URL should return 404 (not found) or 410 (permanently gone). After the cleanup this happens on its own, because the pages no longer exist.
| Action | What it does | When to use it |
|---|---|---|
| 404 or 410 for the spam URLs | Tells Google the page doesn’t exist. 410 makes it clear that it’s final | Always, this is the foundation |
| Removals tool in Search Console | Temporarily hides URLs from results, for about 6 months | For prominent URL patterns that look embarrassing in search |
| Clean sitemap and resubmit | Points Google to the real pages | After the cleanup |
| Blocking the spam in robots.txt | Not recommended: Google won’t see the 404 and will keep the URLs | Don’t use |
According to Google’s help page on the Removals tool, a temporary removal lasts only about six months, so it is no substitute for 404 or 410. Google also advises against blocking pages in robots.txt when you want them out of the index.
Don’t redirect (301) the spam pages to the homepage. It is better for the spam URLs to return 404 or 410, so Google understands they were removed and not moved. For more on 404 errors and when they are fine, see the 404 error.
How long does it take for rankings to recover?
From cleanup until the Japanese results disappear usually takes a few weeks, and longer on a site with tens of thousands of spam pages. The pace depends on how quickly Google recrawls the URLs.
- If there is a warning in Security Issues, send a Request Review after the cleanup. According to Google, the review takes from a few days to a few weeks.
- Watch the number of indexed pages drop in the Pages report in Search Console. It is the clearest measure of progress.
- Rankings of real pages usually return once the spam is gone, but there is no guaranteed date.
How did the attacker get in, and how do you prevent a repeat?
The same Google guide says that about 20% of hacked sites are hacked again within a day. So finding the hole matters as much as the cleanup.
- A vulnerable plugin or theme: the most common cause. On Cloudways, the Vulnerability Scanner warns about vulnerable WordPress components.
- A weak or leaked password: two-factor authentication for every admin.
- A “nulled” theme or plugin: pirated versions usually ship with a backdoor.
- An old site on the same server: an abandoned site on the same server can serve as an entry point. Delete sites you no longer use.
Full post-hack guidance: site hacked: what to do and removing malware from WordPress.
Which common mistakes bring the spam back?
Deleting pages without cleaning the files: the pages get regenerated from code that is still on the server.
Leaving the foreign owner in Search Console: the attacker can submit sitemaps and see your data.
Checking only in the browser: because of the cloaking, the site will look clean to you. Check with URL Inspection.
Don’t want to handle this yourself? On the website maintenance page I broke down what a maintenance package should include and what it costs.
Frequently asked questions
It is a hack that adds automatically generated Japanese-language pages to your site, with links to fake online stores. Google calls it the Japanese keyword hack. The attacker usually hides the pages from you and shows them only to Google.
Because of cloaking: the malicious code recognizes Google and serves it spam, while serving you a 404 or a normal page. Check the URL in the Search Console URL Inspection tool to see what Google sees.
After cleaning the site, the URLs should return 404 or 410, and Google drops them on its next crawl. The Removals tool in Search Console hides URLs for about six months, but it is only a temporary fix.
Usually a few weeks, and longer on sites with many spam pages. It depends on how quickly Google recrawls the URLs. Track the number of indexed pages in Search Console.
No. It is better for the spam URLs to return 404 or 410, so Google understands they were removed.
Usually not. After a full cleanup and getting the pages out of the index, the rankings of your real pages come back gradually. The danger is a repeat hack, so you have to close the hole.
Related guides
- Site hacked: what to do in the first 24 hours
- Removing malware from a WordPress site
- The 404 error: what it is and when to fix it
- Malware Protection on Cloudways
- Cloudways review: who it is for
- All security guides
Sources
- Fix the Japanese keyword hack – Google’s web.dev (detection, cleanup, 20% get hacked again; checked 7 Nov 2026)
- Removals tool – Google Search Console Help (temporary removal for about 6 months, 404/410)
- Security Issues report – Google Search Console Help (Request Review and review times)
- Cloudways Malware Protection – file and database cleanup, pricing
- How to Use Malware Protection – Cloudways Knowledge Base
Official sources: Google: Fix the Japanese keyword hack and Cloudways Knowledge Base. This guide was written and checked by Asael Dreyer · Updated: 7 Nov 2026
Disclosure: this is an independent site, not the official Cloudways site. Some links on this site are affiliate links: if you sign up through them we earn a commission, at no extra cost to you. Full details