Casino spam links on your WordPress website: how to find and remove them
Casino, betting and “slot gacor” links are the most common kind of SEO spam injected into hacked WordPress sites. The point is not your visitors: it is your domain’s standing in Google, which the attacker borrows to rank gambling pages or to pass link value to them. That is why the spam is usually hidden. It may be a block of links pushed off-screen in the footer, hundreds of new pages that never appear in your menus, or text that is shown only when Googlebot asks for the page, so you see a normal site and Google sees a casino. You usually find out from a site: search, a Search Console warning, a sudden drop in rankings, or an SEO tool reporting outbound links you never added. This guide covers how to find every form of the spam without changing anything, how to remove it without damaging the pages that rank, how to get Google to drop it, and why removing the links is not the same as closing the hole.
Prepared by G. Schad, WordPress and Linux security specialist
Casino, betting or slot links in your pages, or gambling pages under your domain in Google results
Who it targets
Google, not your visitors: the spam is often hidden from people and shown to Googlebot
Where it lives
Theme files, widgets, post content, new posts, static HTML folders, or .htaccess
Recovery
Remove every copy, close the way in, then request a review in Search Console if Google flagged the site
Why casino spam
Why gambling links end up on ordinary business websites
Online gambling, especially in markets where it is restricted, is one of the most competitive and best-paid niches in search, and legitimate links are hard to get. Hacked sites supply them. An established domain with a few years of history passes far more ranking value than a new one, so a small business site, a school or a charity is worth more to a spammer than its owner might expect.
The spam usually takes one of three forms, often several at once: hidden links added to pages that already exist, new pages or posts published under your domain, and content that is shown only to search engine crawlers. Each one is stored somewhere different, so the search has to cover all three.
The forms it takes
Three forms of casino spam and how each one hides
Figure 1 · Three kinds of casino spam
Hidden links, spam pages and cloaked content: what each looks like and where it lives.
Form of spam
How you find it
Where it is stored
Hidden links in your pages
Page source shows casino links in a hidden block
Footer or theme file, widgets, post content
New spam pages or posts
site:yourdomain casino shows pages you never wrote
wp_posts, or static HTML files in a folder
Shown only to Googlebot
Visitors see nothing; Search Console’s URL Inspection shows gambling text
PHP that checks the user agent, or .htaccess
Most infections use more than one form. Search for all three before you start removing anything.
Hidden links in existing pages
A block of links styled with display:none, a font size of zero, or positioned thousands of pixels off-screen. People never see it; crawlers read it. It is usually printed by the theme’s footer, a widget or a line of PHP added to functions.php, so it appears on every page at once.
New spam pages or posts
Hundreds or thousands of pages about casinos, slots or betting, published as posts, as pages, or as static .html files in a new folder. They are left out of your menus and sitemap so you do not notice them, then submitted to Google through a sitemap the attacker adds.
Content shown only to Googlebot
PHP code that checks the visitor’s user agent or IP address and serves gambling text only to search engine crawlers. You see your real site; Google indexes something else, and your result titles in Search change to casino keywords.
Links in comments and user profiles
The mildest form, and not always a hack: spam comments and open registration can fill a site with gambling links without anyone breaking in. It still harms rankings, and it is fixed differently, with moderation and closed registration.
Find it
Read-only checks to find every casino link
Nothing below changes the site. Replace example.com with your own domain. The WP-CLI commands run from the WordPress root over SSH or your host’s terminal.
01
Search Google for your own domain
In Google, search for site:example.com casino, then repeat with slot, betting, poker and gacor. Pages you never wrote, or your real pages with gambling words in their titles, confirm the problem and show which form it takes.
In Search Console, also check Security & Manual Actions, Pages, and Sitemaps for any sitemap you did not submit.
02
Compare what Googlebot gets with what you get
Cloaked spam is served only to crawlers, so ask for the page both ways:
Words that appear only in the Googlebot copy prove the content is cloaked. Some spam checks Google’s IP addresses too, so a clean result here does not rule cloaking out; Search Console’s URL Inspection shows exactly what Google fetched.
03
Search the database
WP-CLI searches every table, including post content, widgets, options and user profiles:
WP-CLI
$ wp db search "casino"--all-tables-with-prefix--stats$ wp db search "slot gacor"--all-tables-with-prefix--stats$ wp post list --post_type=any--post_status=any--orderby=date--order=DESC--fields=ID,post_type,post_date,post_title--posts_per_page=50
The last command lists the newest content. A run of posts or pages created minutes apart, by an author you do not recognise or at a time nobody was working, is the spam.
04
Search the files
Look for gambling words in PHP, static HTML outside WordPress, and crawler checks:
Some legitimate plugins mention Googlebot, so judge each match by what it does when the visitor is a crawler.
05
Check who can publish
Spam pages need an author. List the accounts that can create content:
WP-CLI
$ wp user list --role=administrator--fields=ID,user_login,user_email,user_registered$ wp user list --role=editor--fields=ID,user_login,user_email,user_registered
An account you do not recognise, especially one registered around the date the spam started, is how it was published.
Remove it
Remove the spam without losing the pages that rank
The order matters: if you delete the spam before you find what wrote it, the evidence goes with it, and the spam usually comes back.
01
Preserve the evidence
Export the database and archive the files outside the web root, and save a copy of the spam URLs Google shows:
Remove rogue administrators, update or remove the vulnerable plugin or theme, replace modified Core and plugin files with clean copies, and remove any backdoor, mu-plugin or scheduled task the spam depends on. Then change every administrator password, the database password and the WordPress salts.
03
Delete the spam pages and links
Delete spam posts and pages, static spam folders and the attacker’s sitemap. Remove hidden link blocks from the theme by replacing the theme files with a clean copy rather than editing them. Remove links from post content with WP-CLI search-replace after a dry run, never a raw SQL REPLACE.
04
Let the spam URLs return 404 or 410
Do not redirect spam URLs to your home page: Google treats that as a soft 404 and keeps the URLs around longer. A 404 or 410 tells Google the pages are gone. If the spam URLs share a folder or pattern, a 410 rule for that pattern speeds up removal.
05
Tell Google
If Search Console shows a security issue or a manual action, request a review once everything is clean, and describe what you removed and how you closed the hole. Use the Removals tool to hide the worst URLs from results for about six months while Google recrawls. Submit your real sitemap again.
Google’s spam policies treat hacked content and hidden links as violations. Sites can lose rankings for their own keywords, or have results replaced by the spam pages.
Warnings appear in results
Google can show “This site may be hacked” under your listing, which most searchers will not click past.
Manual actions
A reviewer at Google can apply a manual action for hacked content or for spam, removing pages or the whole site from results until a reconsideration request is accepted.
Recovery takes weeks
Even after a clean-up, Google has to recrawl every spam URL before it disappears. Starting the clean-up early shortens that tail.
Casino spam is one branch of the same SEO spam family
The same infections that plant gambling links also publish pharmacy, replica and Japanese-language spam, and switch between them as the attacker’s customers change. If your site shows a different kind of spam next month, it is very likely the same access, not a new hack.
Because they are hidden from people. They may be in the page source but styled so they do not show, published on pages that are not in your menus, or served only to Googlebot. View the page source and search for casino, run a site: search in Google, and compare a Googlebot request with a normal one.
How did casino spam get onto my WordPress site?
Usually through an outdated plugin or theme with a known vulnerability, a reused or stolen administrator password, or a nulled copy of a paid theme or plugin. Less often, through another hacked site on the same hosting account. The spam is the result; the way in is what needs closing.
Will deleting the spam pages fix my rankings?
It starts the recovery, but Google has to recrawl the spam URLs and see them gone, which can take weeks. Let them return 404 or 410, resubmit your real sitemap, and request a review in Search Console if Google flagged the site. Rankings usually recover once the spam is out of the index and has not returned.
Should I disavow the casino links?
Not for links on your own site: removing them is what counts. Disavowing is for links from other sites pointing at yours, and Google ignores most spammy inbound links without it.
The spam came back after I deleted it. Why?
The code or account that published it is still there: a backdoor, a scheduled task, a rogue administrator or a plugin that is still vulnerable. Find and remove that first, then delete the spam again.
How much does it cost to have casino spam removed?
A single-site cleanup here is a fixed fee from $120 to $500, agreed before work starts, with a reply the same business day. It covers the spam in files and database, the way in, the backdoors, and the Search Console steps needed for Google to drop the spam.
Choose the response path
Gambling spam means your site is being rented out. Choose how to take it back.
Spam in Google right now
Get the spam, the backdoors and the way in removed, and Google told.
Best when casino pages or links are live today and your rankings or your Google listing are suffering. Fixed fee from $120, a reply the same business day, and help with the Search Console review.
Find out how they got in, across every site on the account.
Best when more than one site shows spam, or it returned after a cleanup: an audit finds the shared weakness, the vulnerable components and the accounts, and gives you a written list to fix.