You check your site’s performance in Google and your heart sinks. Instead of your normal page titles, you see a flood of Japanese characters. Your site has been targeted by the notorious Japanese keyword hack, a frustrating and damaging form of SEO spam. This attack leverages your website’s authority to rank for spammy keywords, potentially leading to Google penalties and a loss of visitor trust. Don’t panic. This guide provides a comprehensive, step-by-step process to clean the Japanese SEO spam WordPress infection, secure your site, and restore your reputation.
This definitive guide is brought to you by Joynal Abdin, a top-rated WordPress security expert with over a decade of experience cleaning thousands of hacked websites.

Table of Contents
- What is Japanese SEO Spam and How Does It Work?
- Telltale Symptoms: How to Spot the Japanese Keyword Hack
- Step 1: Initial Containment and Assessment
- Step 2: Finding and Removing Malicious Files
- Step 3: Cleaning the WordPress Database from Japanese SEO Spam
- Step 4: Removing Injected Pages and Sitemaps
- Step 5: Hardening WordPress to Prevent Re-infection
- Frequently Asked Questions
- Need Expert Help?
What is Japanese SEO Spam and How Does It Work?
The Japanese SEO spam (also known as the Japanese Keyword Hack) is a specific type of black-hat SEO attack where hackers inject a target WordPress site with thousands of auto-generated pages filled with Japanese text and affiliate links. These links typically point to sites selling counterfeit merchandise, pharmaceuticals, or other illicit goods. The goal isn’t to deface your homepage but to silently use your domain’s reputation to boost the search engine ranking of their spammy products.
Attackers gain entry through various means, most commonly by exploiting vulnerabilities in outdated plugins or themes. Once inside, the malware performs several actions:
- Creates Spam Pages/Posts: The script generates thousands of new posts or pages within your WordPress database. These pages are often hidden from your regular site navigation but are visible to search engine crawlers.
- Modifies Core Files: Hackers may alter files like
.htaccessto redirect users or crawlers, orindex.phpto load their malicious scripts. - Generates Spam Sitemaps: To ensure Google quickly finds and indexes their spam pages, attackers create new XML sitemaps (e.g.,
sitemap-abc.xml) and sometimes even submit them to your Google Search Console account if they gain access. - Creates Backdoors: The hack almost always includes a “backdoor”—a hidden script that allows the attacker to regain access even after a partial cleanup. This is why thoroughness is critical.
This attack is particularly insidious because your site might look completely normal to you and your direct visitors. The spam content is often cloaked, meaning it’s only shown to Google’s crawlers, making detection difficult until you see the evidence in search results or receive a notification from Google Search Console.
Telltale Symptoms: How to Spot the Japanese Keyword Hack
Early detection is key to minimizing SEO damage. Be on the lookout for these clear indicators of a Japanese SEO spam infection. The most common sign is seeing strange Japanese titles and descriptions when you search for your site on Google using the site:yourdomain.com operator. The spam pages will appear alongside your legitimate content.
Other major symptoms include:
- Google Search Console Alerts: You may receive an email from Google with the subject “Hacked content detected on [your site]”. Inside Search Console, you’ll see warnings under the “Security Issues” tab.
- Strange New Pages: When logged into your WordPress admin, you might see thousands of new, unpublished pages or posts with Japanese titles under “All Pages” or “All Posts”.
- New User Accounts: Check your WordPress users list for any unauthorized accounts, especially those with administrator privileges. Attackers often create their own admin accounts to maintain control.
- Suspicious Files: You might discover strangely named PHP files in your core directories or, most commonly, PHP files disguised as images (e.g.,
image.jpg.php) within your/wp-content/uploads/folder. - Unusual Sitemaps: The presence of XML sitemaps you didn’t create (e.g.,
sitemap-1a2b.xml,sitemap-post-123.xml) in your root directory is a strong sign.
Step 1: Initial Containment and Assessment
Once you’ve confirmed an infection, your first priority is to prevent further damage and lock the attacker out. Take a deep breath and work methodically. Rushing can lead to mistakes that make recovery harder. Start by putting your site into maintenance mode to prevent visitors from landing on spam pages or being redirected.
Next, perform a full password reset for every access point related to your website. This is non-negotiable. Change the passwords for:
- All WordPress administrator accounts.
- Your hosting control panel (cPanel, Plesk, etc.).
- FTP/SFTP accounts.
- Your WordPress database user (via your hosting panel).
- Your phpMyAdmin login.
Before you delete anything, take a full backup of the current, infected site. This might seem counterintuitive, but this backup is a critical piece of evidence. If your cleanup efforts fail or you need to hire a professional, this backup allows for a proper forensic analysis to understand the full extent of the hack. After securing this backup, you can also restore a known-clean backup from before the infection occurred if you have one, but a full cleanup is still necessary to close the vulnerability the attacker used.
| Cleanup Method | Pros | Cons |
|---|---|---|
| DIY Cleanup | No immediate cost, learning experience. | Time-consuming, high risk of missing backdoors, may lead to re-infection, requires technical skill (SSH, SQL). |
| Professional Service | Fast (often <24 hours), thorough, guaranteed results, includes security hardening, peace of mind. | Involves a financial cost. |
Step 2: Finding and Removing Malicious Files
The file-based part of the hack often involves obfuscated code and backdoors hidden in unexpected places. Manual inspection is tedious, so using command-line tools via SSH is the most effective approach. If you don’t have SSH access, contact your hosting provider to enable it or consider an emergency cleanup service.
Connect to your server via SSH and navigate to your WordPress root directory. Use the `grep` command to search for common malicious PHP functions used in these hacks. Pay close attention to functions like `eval`, `base64_decode`, `gzinflate`, `str_rot13`, and `shell_exec`.
# Search for files containing suspicious functions recursively from the current directory
grep -rE "(eval|base64_decode|gzinflate|str_rot13|shell_exec)\(.*\)" .
Review the output carefully. Not every result is malicious (some plugins use these functions legitimately), but code that is heavily obfuscated and nonsensical is a major red flag. Another powerful tool is WP-CLI. Run a checksum verification to see if any core WordPress files have been modified.
# Check if core WordPress files match the official versions
wp core verify-checksums
If WP-CLI reports modified files, you can replace them with fresh copies from a new WordPress download. Also, manually inspect these critical files for any injected code: .htaccess, index.php, and wp-config.php. Look for any rules or PHP includes that you don’t recognize. Lastly, thoroughly scan your /wp-content/uploads/ directory for any PHP files. This directory should only contain media files, so any executable script found here is almost certainly malicious.

Step 3: Cleaning the WordPress Database from Japanese SEO Spam
Removing infected files is only half the battle. The core of the Japanese SEO spam WordPress hack lives inside your database, where the thousands of spam pages are stored. You will need a database management tool like phpMyAdmin (available in most hosting control panels) or Adminer to clean this up.
Once inside your database, select your WordPress database and navigate to the `wp_posts` table. You can use the search or query function to find the malicious content. A simple search for Japanese characters can reveal the infected posts. Run an SQL query to locate all posts containing Japanese content. The following is an example; you may need to adjust the table prefix (`wp_`) if yours is different.
SELECT *
FROM `wp_posts`
WHERE `post_content` LIKE '%アフィリエイト%' -- "affiliate" in Japanese
OR `post_title` LIKE '%コピー%' -- "copy" in Japanese
OR `post_status` = 'publish' AND `post_date` > 'YYYY-MM-DD'; -- Posts published after a known clean date
Examine the results to confirm they are indeed spam. Once confirmed, you can construct a `DELETE` query to remove them. Warning: Always back up your database before running a `DELETE` query. A mistake here can permanently destroy your legitimate content. Also, check the `wp_users` table for unauthorized admin users and delete them. Finally, inspect the `wp_options` table for any suspicious entries, specifically checking the `siteurl` and `home` options to ensure they haven’t been hijacked.
“Database cleanup is where most DIY attempts fail. Attackers are clever; they hide malicious entries and triggers. Simply deleting visible spam posts isn’t enough. You have to eradicate the script that generates them, or you’ll be cleaning up again next week.” – Joynal Abdin
Step 4: Removing Injected Pages and Sitemaps
After identifying the spam posts in the database, you need to remove them efficiently. Deleting thousands of pages one-by-one from the WordPress admin is impractical. Using SQL as described in the previous step, or WP-CLI, is the professional method. With WP-CLI, you can use a script to delete posts based on their IDs or other criteria like post date.
For example, if you’ve identified that all spam posts were created after a specific date, you could use a command script to delete them:
# Example WP-CLI command to delete posts created on a specific day (use with extreme caution)
wp post delete $(wp post list --post_type='page' --format=ids --post_date='YYYY-MM-DD') --force
Next, you must address the spam sitemaps. Look in your website’s root directory via FTP or your file manager for any XML files with random-looking names (e.g., `sitemap-x4f2.xml`, `gss-1.xml`). These were created by the attacker to get their spam pages indexed quickly. Delete all of them. Then, resubmit your legitimate sitemap (usually sitemap.xml or sitemap_index.xml) in Google Search Console. You may also need to use the “Removals” tool in Search Console to request the temporary removal of the spammy URLs or the directory they were created in while Google recrawls your clean site.

Step 5: Hardening WordPress to Prevent Re-infection
A cleanup without security hardening is a wasted effort. You must close the security hole the attackers used to get in, or they will be back. This final step is the most important for long-term website health.
Follow this checklist to secure your WordPress installation:
- Update Everything: Ensure WordPress core, all plugins, and all themes are updated to their latest versions. Attackers thrive on outdated software.
- Remove Unused Code: Delete any plugins and themes you are not actively using. Even disabled, they can be a security risk.
- Install a Security Plugin: A reputable security plugin like Wordfence or Sucuri provides a web application firewall (WAF), malware scanning, and login protection. This is your first line of defense.
- Enforce Strong Passwords: Use a policy to enforce strong, unique passwords for all users, especially administrators. Enable Two-Factor Authentication (2FA).
- Correct File Permissions: Set your directory permissions to 755 and file permissions to 644. Your
wp-config.phpfile should be set to 600 for extra protection. - Disable File Editing: Add the following line to your
wp-config.phpfile to prevent anyone from editing plugin or theme files from the WordPress admin dashboard:define('DISALLOW_FILE_EDIT', true); - Change WordPress Salts/Keys: Your
wp-config.phpfile contains a set of security keys. Generate a new set using the official WordPress salt generator and replace the old ones. This will log out all users and invalidate existing cookies.
Completing these hardening steps dramatically reduces your risk of being hacked again. For a truly secure setup, consider a Professional WordPress malware removal service, which includes comprehensive hardening as part of the package.
Frequently Asked Questions
Why is my WordPress site showing Japanese text?
This is a classic symptom of the Japanese keyword hack, a type of SEO spam where attackers inject your site with auto-generated pages containing Japanese text and links to sell counterfeit goods. They do this to leverage your site’s SEO authority and redirect traffic or build backlinks.
Will removing the Japanese SEO spam affect my real SEO rankings?
Initially, your rankings might fluctuate as Google processes the removal of thousands of spam pages and re-crawls your clean site. However, cleaning the hack is absolutely essential for long-term SEO health. A hacked site penalty from Google will cause far more severe and lasting damage than any temporary dip during the cleanup process.
How did the hackers get in?
The most common entry points are security vulnerabilities in outdated software. This includes an old version of a plugin, theme, or WordPress core itself. Other possibilities include weak administrator passwords, insecure file permissions on your server, or cross-site contamination from another hacked site on a shared hosting account.
Can I just delete the pages from the WordPress admin?
No, this is highly ineffective and a common mistake. The Japanese SEO spam is more than just visible pages; it involves malicious files, database injections, and hidden backdoors. Simply deleting the pages you can see in the WP admin does not remove the underlying infection. The spam will regenerate, often within hours, until the core malware is fully eradicated.
Need Expert Help Removing Japanese SEO Spam from WordPress?
Dealing with a hacked site is stressful and time-consuming. The Japanese SEO spam WordPress hack is particularly persistent, and a single missed backdoor can lead to immediate re-infection. Don’t risk your website’s reputation and your time trying to hunt down every last piece of malicious code.
We will completely clean and secure your site from Japanese SEO spam within 24 hours, guaranteed.
- 24-Hour Turnaround: We get your site back online, clean and secure, fast.
- 30-Day Guarantee: If the hack reappears within 30 days, we’ll clean it again for free.
- Trusted Expert: Joynal Abdin is a 6+ years senior expert with a 4.9-star rating from over 100 happy clients.
Let the experts handle it so you can get back to running your business. Get a clean, hardened, and protected website today.
