How to Remove SEO Spam from a Hacked WordPress Website

9 Aug 2026Updated 26 Sept 202610 min read
Sefat Hossain, WordPress security specialist
By
Share
How to Remove SEO Spam from a Hacked WordPress Website

Quick answer

Learn how to remove SEO spam from a hacked WordPress website, find injected pages and links, clean files and databases, and prevent reinfection.

Finding unexpected spam pages, strange links, or unrelated search results for your WordPress website can be a sign that your website has been compromised.

Hackers often abuse compromised WordPress websites to create spam pages, inject unwanted links, add pharmaceutical or gambling content, or redirect visitors to unrelated websites. Google describes hacked content as content placed on a website without the owner's permission because of a security vulnerability. :contentReference[oaicite:1]{index=1}

This type of attack is commonly called SEO spam, spam injection, or Japanese keyword hack when the injected content uses Japanese or other foreign-language keywords.

Removing the visible spam page is not always enough. A proper cleanup should identify how the attacker gained access, remove malicious content from the website files and database, check for backdoors, and secure the original entry point.

This guide explains how to remove SEO spam from a hacked WordPress website and what to check after cleanup.

What Is SEO Spam on WordPress?

SEO spam is unwanted search-engine-oriented content that has been added to a website without the owner's permission.

The attacker typically wants to use the authority or existing reputation of a legitimate website to promote unrelated pages, products, links, or websites.

SEO spam can appear in several forms:

  • Spam pages
  • Spam posts
  • Injected links
  • Hidden text
  • Unwanted redirects
  • Foreign-language pages
  • Pharmaceutical spam
  • Casino or gambling spam
  • Adult-content spam
  • Fake product pages
  • Automatically generated URLs

Google's Security Issues documentation specifically includes hacked content such as spammy links or text injected into pages and hacked URLs created by an attacker. :contentReference[oaicite:2]{index=2}

How Do You Know If Your WordPress Website Has SEO Spam?

SEO spam is not always visible when you browse your website normally.

Some attackers deliberately hide spam from the website owner while showing it to search engines or visitors coming from specific sources. Google also notes that hackers can use cloaking techniques to hide spammy content from site owners. :contentReference[oaicite:3]{index=3}

Common warning signs include:

  • Unexpected pages appearing in Google
  • Unrelated keywords appearing in search results
  • Japanese or foreign-language pages you did not create
  • Casino or pharmaceutical pages
  • Strange URLs containing random words
  • Unexpected external links
  • Sudden ranking changes
  • Unexpected redirects
  • Spam content appearing in the website source
  • Google Search Console security warnings

Why Does SEO Spam Happen on WordPress?

SEO spam usually appears after an attacker gains unauthorized access to the website.

Possible entry points include:

  • Vulnerable plugins
  • Outdated WordPress software
  • Vulnerable themes
  • Compromised administrator accounts
  • Weak passwords
  • Exposed hosting credentials
  • Insecure server configurations
  • Previously installed malware

Google notes that hackers can exploit vulnerabilities in content management systems such as WordPress or third-party plugins to inject unwanted content. :contentReference[oaicite:4]{index=4}

This is why removing spam without fixing the vulnerability can result in the spam returning.

SEO Spam vs. Normal WordPress Content

Not every unexpected page is necessarily malware.

Before deleting content, determine whether it was intentionally created by the website owner, a legitimate administrator, or a trusted plugin.

Spam is more likely when the content:

  • Has no relationship to the website's business
  • Was not created by an authorized user
  • Contains unusual keywords or external links
  • Uses automatically generated URLs
  • Appears in large numbers
  • Contains unrelated pharmaceutical, gambling, adult, or financial content
  • Redirects visitors to another website

How to Find SEO Spam on a WordPress Website

1. Check Google Search Console

Start with Google Search Console.

Open the Security Issues report and check whether Google has detected hacked content, malware, or other security problems.

Google says the Security Issues report can show sample URLs affected by a detected security issue. However, the sample URLs are not necessarily a complete list of every affected page. :contentReference[oaicite:5]{index=5}

Therefore, do not limit the investigation to the URLs displayed in the report.

2. Search Google Using Your Domain

Use a site-restricted search to look for unexpected pages.

site:example.com

Replace example.com with your own domain.

Review the results for pages that you do not recognize.

You can also search for suspicious keywords that are unrelated to your business.

site:example.com casino
site:example.com viagra
site:example.com loans

These are only examples. Use search terms relevant to the type of spam you suspect.

Google's own guidance recommends using site-restricted searches to identify unexpected hacked or spam pages. :contentReference[oaicite:6]{index=6}

3. Check Google Search Console's Performance Data

Search Console's Performance report can sometimes reveal unexpected queries that your website should not be ranking for.

For example, a WordPress business website may suddenly receive impressions for unrelated pharmaceutical, casino, adult, or foreign-language queries.

This can be an important clue that spam content has been indexed.

4. Inspect WordPress Pages and Posts

Log in to WordPress and review the Pages and Posts sections.

Look for:

  • Unknown posts
  • Unexpected pages
  • Drafts you did not create
  • Unusual authors
  • Spam comments
  • Modified existing content

Do not assume that every malicious page will appear in the normal WordPress dashboard. Some attacks create content through direct database manipulation or other methods.

How to Remove SEO Spam from WordPress

Once you confirm that the content is unauthorized, begin a structured cleanup.

Step 1: Take a Backup

Create a backup of the current website files and database before making major changes.

Keep the backup separate from the live website.

Remember that a backup taken after the compromise may contain malicious content, so it should not automatically be treated as a clean restoration point.

Step 2: Scan the Website for Malware

Run a reputable WordPress security scan.

Check for:

  • Malicious PHP files
  • Modified WordPress core files
  • Modified plugins
  • Modified themes
  • Suspicious JavaScript
  • Backdoors
  • Unexpected administrator accounts
  • Malicious redirects

Automated scanning is useful, but a scan alone should not be treated as proof that the entire website is clean.

Step 3: Clean Spam Pages and Posts

Remove unauthorized pages and posts after confirming that they are malicious.

Do not simply change their status to draft if the content is part of a broader compromise.

Investigate why the attacker was able to create the content in the first place.

Search existing content for malicious links that were added without permission.

Check:

  • Posts
  • Pages
  • Widgets
  • Menus
  • Theme content
  • Plugin settings
  • Database records

Be careful when using bulk database replacements. Incorrect replacements can damage legitimate website content.

Step 5: Check the WordPress Database

SEO spam can be stored directly in the database.

Review relevant tables for:

  • Spam posts
  • Spam pages
  • Injected links
  • Hidden text
  • Malicious scripts
  • Unexpected administrator data
  • Suspicious option values

Cleaning only the WordPress filesystem may leave database-based spam behind.

Step 6: Inspect WordPress Files

Review WordPress core files, plugin files, theme files, and writable directories for unauthorized modifications.

Pay particular attention to recently modified files and unexpected PHP files.

Suspicious code can sometimes be hidden or obfuscated, making manual review important during a serious compromise.

Step 7: Check for Backdoors

A backdoor is especially dangerous because it can allow an attacker to regain access after the visible spam has been removed.

Backdoors may be placed inside:

  • Plugin files
  • Theme files
  • Upload directories
  • WordPress core files
  • Custom PHP files
  • Server configuration files

If a backdoor remains, the website may become infected again.

Why Does SEO Spam Keep Coming Back?

Repeated SEO spam usually indicates that the underlying compromise has not been fully resolved.

Common causes include:

  • A vulnerable plugin was not updated
  • A compromised administrator account remains active
  • A backdoor was missed
  • Malicious database content remains
  • Hosting credentials were compromised
  • The original entry point was not fixed
  • Another website on the same hosting account is infected

Removing spam is only one part of the recovery process.

How to Remove Japanese SEO Spam from WordPress

One common form of WordPress SEO spam is sometimes called the Japanese keyword hack.

The website may suddenly contain Japanese-language pages or search results even though the business does not publish Japanese content.

These pages can contain:

  • Japanese keywords
  • Fake product pages
  • Unrelated commercial links
  • Automatically generated URLs
  • Spam metadata

If you discover this type of content, treat it as a potential website compromise rather than simply an SEO problem.

Investigate the files, database, administrator accounts, and original vulnerability.

How to Remove Casino and Gambling SEO Spam

Casino and gambling spam can appear on compromised WordPress websites through injected pages, posts, links, or redirects.

Search your website for unexpected casino-related keywords and URLs.

Then investigate both the visible content and the underlying source of the injection.

Deleting the spam pages without removing the malware or access mechanism can allow the attacker to recreate them.

How to Remove Pharmaceutical SEO Spam

Pharmaceutical spam can include unrelated drug-related keywords, product pages, or external links.

Search Google for suspicious terms together with your domain and review unexpected results.

Also inspect your database and website files because the spam may be generated dynamically rather than stored as an obvious WordPress post.

Google specifically identifies pharmaceutical terms as an example of spammy content that can be injected into hacked websites. :contentReference[oaicite:7]{index=7}

What Is a Japanese Keyword Hack?

A Japanese keyword hack is a type of SEO spam attack in which attackers add Japanese-language spam content or pages to a compromised website.

The goal is generally to manipulate search visibility or promote unrelated products and websites.

The same underlying compromise can also be used to create English, Chinese, or other foreign-language spam.

The language of the spam does not change the fundamental security problem: unauthorized content has been added to the website.

Can SEO Spam Affect Google Rankings?

Yes, hacked or spammy content can affect how a website appears in search.

Google states that it tries to keep hacked content out of search results to protect users and maintain search-result quality. :contentReference[oaicite:8]{index=8}

Depending on the situation, a compromised website may also receive security warnings, lose visibility for legitimate content, or have unexpected pages indexed.

The exact search impact depends on the type and scope of the compromise.

Can SEO Spam Cause a Google Security Warning?

It can, depending on what the compromised website is serving.

Google's Security Issues report covers hacked content, malware and unwanted software, and social engineering. A compromised website can therefore have both SEO spam and security-related problems at the same time. :contentReference[oaicite:9]{index=9}

If your website is showing a browser or Google security warning, investigate the issue through Google Search Console rather than treating it as an ordinary SEO problem.

You can also read How to Fix a Google Security Warning on a WordPress Website.

What Should You Do After Removing SEO Spam?

After removing the spam, continue with the security recovery process.

Update WordPress

Make sure WordPress core is running a supported and secure version.

Update Plugins and Themes

Update legitimate plugins and themes and remove software that is no longer required.

Remove Unused Plugins and Themes

Unused software increases the amount of code that needs to be maintained and can become an unnecessary security risk.

Change Passwords

Reset important credentials after a compromise.

Depending on the incident, this may include WordPress administrator accounts, hosting, FTP/SFTP, SSH, database, and other relevant credentials.

Review User Permissions

Make sure only trusted users have administrator-level access.

Enable Two-Factor Authentication

Where supported, use two-factor authentication for administrator accounts.

Improve Website Security

After cleanup, harden the WordPress installation and reduce the chance of another compromise.

For a broader hardening strategy, see the WordPress Security Hardening service.

Should You Request a Google Review After Removing SEO Spam?

If Google has reported a security issue through Search Console, make sure the entire issue has been fixed before requesting a review.

Google explains that a review request should describe the problem, the steps taken to fix it, and the outcome. :contentReference[oaicite:10]{index=10}

Do not request a review simply because the visible spam pages have disappeared.

First verify that the website is clean and that the vulnerability has been addressed.

Google also notes that sample affected URLs in the Security Issues report are not necessarily a complete list. :contentReference[oaicite:11]{index=11}

SEO Spam Cleanup Checklist

Check Action
Google Search Console Review Security Issues and affected sample URLs
Google Search Search for unexpected indexed pages and keywords
WordPress Posts Remove unauthorized spam content
WordPress Pages Remove malicious pages
Database Check for injected links, scripts, and spam
Plugins Check for vulnerabilities and modifications
Themes Inspect for unauthorized changes
Users Remove unauthorized administrator accounts
Backdoors Investigate hidden persistence mechanisms
Credentials Reset compromised passwords
Security Harden the website and fix the entry point
Google Review Request review after the issue is fully fixed

Frequently Asked Questions

What is SEO spam on WordPress?

SEO spam is unauthorized content, links, pages, or other search-engine-oriented material added to a website, often after a compromise. It can include pharmaceutical, gambling, foreign-language, adult, or other unrelated content.

How do I remove SEO spam from WordPress?

Identify the injected content, clean the WordPress files and database, remove unauthorized accounts and backdoors, fix the original vulnerability, and verify that the spam is no longer being generated.

Why does my WordPress website have strange pages in Google?

Unexpected indexed pages can be a sign of hacked content or SEO spam. Check Google Search Console and perform a site-restricted Google search to identify pages you did not create.

What is the Japanese keyword hack?

The Japanese keyword hack is a form of SEO spam where attackers add Japanese-language pages, keywords, links, or metadata to a compromised website.

Can SEO spam come from the WordPress database?

Yes. Attackers can inject spam into database records, so cleaning only website files may leave malicious content behind.

Why does SEO spam return after I delete it?

Recurring spam often means the underlying compromise remains. A backdoor, vulnerable plugin, compromised account, database injection, or another access point may still be present.

Can SEO spam cause a Google warning?

It can, depending on what the compromised website serves. Google Security Issues can report hacked content, malware, or social-engineering problems, and affected websites can receive warnings in search or browsers. :contentReference[oaicite:12]{index=12}

Should I request a Google review immediately after deleting spam pages?

No. First make sure the security issue has been fully fixed across the website. Then request a review through Search Console when appropriate.

Final Thoughts

SEO spam is more than an SEO problem when it appears on a WordPress website without the owner's permission. It can be evidence of a deeper security compromise.

The safest approach is to investigate the entire website instead of simply deleting the pages that appear in Google.

Check Search Console, search Google for unexpected content, inspect WordPress files and the database, review administrator accounts, look for backdoors, fix the original vulnerability, and strengthen the website after cleanup.

If your WordPress website has unexpected spam pages, malicious links, foreign-language content, or hacked search results, professional investigation can help identify the source of the compromise and clean the website properly.

Learn more about my WordPress Malware Removal service, Google Blacklist Removal service, or WordPress Security Audit.

You can also contact me for a WordPress security assessment.

Free security check

Worried your site is infected?

Get a free security assessment — I'll tell you if your WordPress site is compromised and exactly what it needs. No obligation.

Worried about your own site?