Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Japanese keyword, pharma and casino spam pages: find and fix

OPS-142High impactPartlyBy FunnelGuardPublished Updated
On this page

What this issue is

This is an SEO spam hack. An attacker gets into your site through an outdated plugin, a weak password or a stolen login. They then create many new URLs on your domain, often with random product or keyword names. The pages are filled with Japanese text, online pharmacy terms or casino and gambling terms. Their goal is to rank those pages and send visitors to other sites.

Why it costs you leads or sales

How the hack typically unfolds (Example)
  1. Day 0

    A vulnerable plugin or stolen login lets the attacker upload files.

  2. Days 1-7

    Spam pages and a spam sitemap appear. Your site looks normal to you.

  3. Weeks 2-4

    Spam URLs get indexed. Brand searches show strange titles. Organic traffic and trust drop.

  4. Later

    Google may flag the site or apply a manual action.

  5. After cleanup

    You remove the spam, close the hole and request a review.

Indexed pages on your domainExample numbers
Indexed pages on your domain (example)Before hack: 40 pages; During hack: 12,000 pages; After cleanup: 40 pages04,6009,2004012,00040Before hackDuring hackAfter cleanuppages

Example: a 40-page site before and after a spam injection. Numbers are illustrative.

How to check if your site has it

Look for the signs
  1. Search Google for your own domain

    Search site:yourdomain.com and then add words like viagra, casino, cialis or a Japanese phrase after it. Any result that is not yours is a red flag. Look at the page titles in the results, not only the URLs.

  2. Check Google Search Console

    Open Security issues and Manual actions. Then open Pages (indexing) and look for a sudden jump in indexed or 'Discovered' URLs. The Performance report may show queries you never targeted.

  3. Fetch pages as Google would

    Use the URL Inspection tool and view the crawled page for a suspect URL. Cloaked spam shows here even when your browser shows a normal page.

  4. Test with a search-engine user agent

    Run the command below. It requests your homepage as a Google crawler would. Compare it with a normal request. Different content points to cloaking. This is for checking your own site only.

  5. Look at the server files

    Check for recently changed files, unknown PHP files in upload or theme folders, an unfamiliar sitemap file, and changes to .htaccess or index.php. Also check the database for unknown posts or options.

Compare normal and crawler responses for your own sitebash
curl -s https://example.com/ | head -c 2000
curl -s -A "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" https://example.com/ | head -c 2000
# Spam only in the second output suggests cloaking.

How to fix it

Clean the site and close the hole
  1. Put the site in maintenance mode if you can

    This limits damage while you work. Keep your real contact forms and checkout in mind and re-enable them as soon as the site is clean.

  2. Change every credential

    Reset hosting, FTP/SFTP, database, CMS admin and email passwords, and any API keys. Remove admin users you do not recognise. Turn on two-factor login.

  3. Remove injected files and code

    Delete spam folders and unknown files. Replace core files with fresh copies from the official source. Check .htaccess, index.php, theme functions.php and wp-config.php for added code, often hidden with base64_decode or eval.

  4. Clean the database

    Look for spam posts, unknown options and injected scripts in content fields. Remove them, and delete unknown scheduled tasks.

  5. Update everything and delete what you do not use

    Update the CMS, themes and plugins. Delete unused or abandoned plugins and themes, and never use pirated ones. The unpatched component is the usual way in.

  6. Fix your sitemap and robots.txt

    Remove any spam sitemap and any rogue lines. Make sure only your real sitemap is submitted in Search Console.

  7. Make spam URLs return 404 or 410

    Once the files and rows are gone, the spam URLs should return 404 or 410. Do not redirect them to your homepage.

  8. Request a review if Google flagged the site

    If Search Console shows a security issue or manual action, fix it, then use Request review and describe what you cleaned and how you closed the hole.

Where to do the cleanup on your platform
  1. Reinstall core files

    Go to Dashboard > Updates and choose Re-install version, or replace wp-admin and wp-includes with fresh copies by SFTP. Check wp-content/uploads for .php files, which should not be there.

  2. Check users, plugins and themes

    Under Users, delete unknown administrators. Under Plugins and Themes, delete anything unused, and reinstall the rest from fresh downloads.

  3. Scan and harden

    Run a malware scanner plugin from a reputable vendor, and change the salts in wp-config.php to log everyone out.

Search results for your domain

Hacked

  • site: search shows thousands of unknown URLs
  • Titles in Japanese or about pharma and casino
  • Spam sitemap submitted or discovered

Cleaned

  • Only your real pages are listed
  • Spam URLs return 404 or 410 and drop out over time
  • Only your own sitemap is submitted

How to confirm it's fixed

Confirmation checks
  • Spam URLs you listed now return 404 or 410
  • The crawler user agent test shows the same page as a normal visit
  • URL Inspection shows the real page for a few formerly infected URLs
  • No unknown files changed since cleanup, and no unknown admin users exist
  • Search Console shows no security issue or manual action
  • Only your real sitemap is listed in Sitemaps
  • site:yourdomain.com plus spam words returns fewer spam results week by week

How to prevent it happening again

Prevention
  • Turn on automatic updates for the CMS, plugins and themes where safe
  • Delete plugins and themes you do not use
  • Use unique strong passwords and two-factor login for every admin
  • Give people the lowest access level they need
  • Keep off-site backups and test a restore
  • Add Google Search Console for every version of your domain and read its emails
  • Set a monthly reminder to run a site: search for spam words

How FunnelGuard handles this

Questions people ask

What is the Japanese keyword hack?

It is an SEO spam attack where hackers create many pages on your domain filled with Japanese text, usually selling counterfeit goods. The pages are made to rank in Google under your site's reputation. You often cannot see them by browsing, because they may be cloaked.

How do I know if my site has pharma or casino spam pages?

Search Google for site:yourdomain.com viagra and site:yourdomain.com casino. Also check Search Console for security issues and sudden jumps in indexed pages. Unknown URLs or strange titles in the results are strong signs.

Why does my site look normal but Google shows spam?

The spam is probably cloaked, which means it is only shown to search crawlers or visitors from search results. Use the URL Inspection tool in Search Console, or request the page with a crawler user agent, to see what Google sees.

How do I remove Japanese spam pages from Google?

First delete the injected files and database rows and close the security hole, so the spam URLs return 404 or 410. Then submit only your real sitemap, use the Removals tool for urgent URLs and request a review if Search Console shows a security issue. Remaining URLs drop out as Google recrawls.

How did hackers get spam onto my website?

Most often through an outdated or vulnerable plugin, theme or CMS, or through weak or stolen passwords. Sometimes it is a compromised hosting account. Cleaning the pages without fixing the entry point lets the spam return.

Should I redirect the spam URLs to my homepage?

No. Let them return 404 or 410 so Google learns they are gone. Redirecting them to the homepage can look like a soft 404 and may keep the junk URLs in the index longer.

Does FunnelGuard detect spam pages injected into my site?

No. FunnelGuard does not check for this yet, though it is a possible future check. It monitors your funnel journeys, tracking and lead delivery, so you should use Search Console and a security scanner for spam pages.

Does FunnelGuard catch this?

Partly

FunnelGuard checks part of this.

How: site safety (Stage 26, daily): spam words and the Japanese keyword hack on the home page.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.