Start a project

WordPress Japanese Keyword Hack: How to Fix It Step by Step

Japanese spam pages in your Google results? How to remove the Japanese keyword hack from WordPress, stop it coming back and recover your rankings.

By Sohail Ashfaq Updated 5 min read

Red padlock on a computer keyboard, representing WordPress security

You search Google for your own site and the results are full of pages in Japanese selling handbags, watches or other products you have never heard of. Your own pages look normal when you visit them. This is the Japanese keyword hack, one of the most common WordPress infections, and if it is not cleaned properly it keeps coming back.

Here is the process I follow when cleaning up a hacked WordPress site, step by step.

Before you start: take a full backup of the files and database as they are now, even though they are infected. If something goes wrong during the cleanup you can always go back, and the infected copy helps you work out how the attacker got in.

How to tell if you have the Japanese keyword hack

  • Searching site:yourdomain.com on Google shows pages with Japanese titles, or URLs you never created.
  • Those pages look normal (or 404) when you open them yourself. The hack often uses cloaking: it shows spam to Googlebot and normal content to you.
  • Google Search Console shows a warning under Security & Manual Actions → Security issues.
  • Search Console shows a sudden jump in indexed pages, or a new sitemap you did not submit.
  • In Settings → Users and permissions in Search Console, there is an owner you do not recognise. Attackers add themselves so they can submit their own sitemaps.

Step 1: Lock down Search Console

Open Search Console, go to Settings → Users and permissions, and remove any owner or user you do not recognise. Also remove the verification token they used (an HTML file in your site root or a meta tag), otherwise they can verify again. Check Sitemaps and remove any sitemap you did not submit.

Step 2: Change every password

Change the passwords for your hosting account, cPanel or hPanel, FTP/SFTP, the database user, and every WordPress administrator. Then generate new security keys and salts and replace them in wp-config.php. This logs out every session, including the attacker’s.

Step 3: Remove unknown admin users

In Users, filter by Administrator. Delete any account you did not create. Attackers often use names that look official, such as “wpadmin”, “support” or a random string. Check the database table wp_users directly too, because some malware hides users from the dashboard.

Step 4: Replace WordPress core files

Download a fresh copy of WordPress from wordpress.org and replace the wp-admin and wp-includes folders completely. Compare the root files (index.php, wp-load.php, wp-settings.php and the rest) against the clean copy and replace any that differ. Keep your own wp-config.php and wp-content.

Step 5: Hunt down the malicious files

This is where most cleanups fail. Look for:

  • .htaccess files with unfamiliar rewrite rules, especially rules that check the user agent for “Googlebot” or redirect based on referrer. Check every folder, not just the root.
  • Unknown PHP files in the root, in wp-content/uploads (PHP should never live there), and in theme and plugin folders.
  • Obfuscated code: long strings passed to eval, base64_decode, gzinflate, str_rot13 or assert.
  • The mu-plugins folder (wp-content/mu-plugins). Plugins here load automatically and do not appear in the normal plugin list.
  • Recently modified files. Sort by modification date around the time the spam first appeared.

Reinstall every plugin and theme from a fresh, official download rather than trying to clean them line by line. Delete any plugin or theme you do not use, and anything nulled or pirated, which is a very common way in.

Step 6: Check the database

Search the wp_options and wp_posts tables for injected scripts, unfamiliar URLs and Japanese text. Pay special attention to siteurl, home, widget content, and options with odd names that autoload.

Step 7: Scan and confirm it is clean

Run a full scan with Wordfence (its scanner compares core, theme and plugin files against the official versions). Then use Search Console’s URL Inspection → Test live URL on one of the spam URLs. This shows you the page as Googlebot sees it, which is the only reliable way to confirm the cloaking is gone.

Step 8: Get the spam out of Google

  • Make sure the spam URLs now return a 404 or 410 status. Do not redirect them to your homepage.
  • Resubmit your real sitemap so Google recrawls your genuine pages.
  • If there was a security warning, use Request review in the Security issues report and explain what you cleaned.
  • For the most visible spam results, the Removals tool hides URLs temporarily while Google recrawls them.

Thousands of spam URLs can take weeks to drop out of the index. That is normal as long as they return 404 or 410.

Step 9: Close the door it came in through

The usual entry points are an outdated or nulled plugin, a weak or reused admin password, or another infected site on the same hosting account. Once clean:

  • Keep core, plugins and themes updated, and remove anything abandoned.
  • Turn on two-factor authentication for every admin.
  • Disable file editing in the dashboard with define( 'DISALLOW_FILE_EDIT', true ); in wp-config.php.
  • Block PHP execution in the uploads folder.
  • Use a firewall (Wordfence or Cloudflare) and keep automatic off-site backups.

Will my rankings come back?

In my experience, rankings usually recover once the spam is gone and Google has recrawled the site, but it takes time, and how long depends on how long the hack was live and how many spam pages were indexed. Watch the Performance and Pages reports in Search Console. If your pages still are not showing up weeks later, work through why your website is not showing up on Google.

If you would rather not do this yourself, get in touch. I clean the site, close the entry point, and handle the Search Console side so your rankings can recover.

Need help with this?

I work with businesses in the US, UK and Europe as a freelance SEO consultant, with dedicated WordPress SEO and WordPress speed optimization services. If your site is slow or has been hacked, send me the address and I will tell you what I would fix first. Start a project →

Sohail Ashfaq

Full stack developer and SEO specialist. I have been building and optimising websites for clients in the USA, UK, Canada and Europe since 2017, and I work as a WordPress engineer at Time54.

Work with me

Want a faster site that ranks?
Let’s talk about your project.