Skip to content

Spam pages in the index (the Japanese keyword hack): how to clean up and recover your rankings

On this page

Last updated: · By

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.com shows 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.

  1. Back up everything: files and database, including the infected state. See backup and restore.
  2. 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.
  3. Replace .htaccess: put in a clean WordPress version. Attackers add redirect rules there that serve spam only to Google.
  4. 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.
  5. Look for hidden code: PHP files that don’t belong to WordPress, recently modified files, and code using base64_decode, eval or gzinflate.
  6. Check scheduled tasks: many hacks install a cron job that restores the files. On Cloudways, this is on the Cron jobs screen.
  7. Clean the sitemaps: delete any sitemap you didn’t create, and remove spam URLs from existing ones.
  8. 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.

Black Friday80% off
80% off 2 months of managed hosting

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).

Ends in—days—hours—minutes—seconds
Code:
Grab the 80% now

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

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.

ActionWhat it doesWhen to use it
404 or 410 for the spam URLsTells Google the page doesn’t exist. 410 makes it clear that it’s finalAlways, this is the foundation
Removals tool in Search ConsoleTemporarily hides URLs from results, for about 6 monthsFor prominent URL patterns that look embarrassing in search
Clean sitemap and resubmitPoints Google to the real pagesAfter the cleanup
Blocking the spam in robots.txtNot recommended: Google won’t see the 404 and will keep the URLsDon’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.

Frequently asked questions

What is the Japanese spam hack on a website?

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.

Why do I see a 404 but Google shows the pages?

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.

How do I remove spam pages from Google?

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.

How long does it take for the Japanese results to disappear?

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.

Should I redirect the spam pages to the homepage?

No. It is better for the spam URLs to return 404 or 410, so Google understands they were removed.

Does the Japanese hack hurt my rankings permanently?

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.

Sources

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

Picture of Asael Dreyer
Asael Dreyer

Hi, I'm Asael Dreyer, CEO of an SEO agency that runs hundreds of websites hosted on dozens of Cloudways servers.
Everything you will find here comes from hands-on experience, mine and my teams', straight from the field: from the guides to the recommendations. All to help you get the most out of Cloudways.

More about me →

Need help? Got a question about your server or this guide? Write to us and we will get back to you.

More guides on this topic:
מפריד
Thanks for your message!
We will get back to you soon.
Ready to get started?

Sign up with the coupon code ASAEL