Hidden Links on a Website: How to Find and Remove SEO Spam
Hidden links and invisible text can damage search trust and may point to injected spam, compromised templates, or bad third-party code.
Jun 10, 2026 | 5 min read
Hidden links are links that exist in the page but are hard or impossible for normal visitors to see. They may use tiny text, off-screen positioning, matching text and background colors, zero-height containers, or CSS that hides the element.
Why attackers add hidden links
The goal is usually search manipulation. Attackers place links to unrelated sites on a domain with existing trust. Visitors may not notice, but crawlers can still discover the links.
Not every hidden element is malicious
Modern websites use hidden elements for menus, modals, accessibility, tabs, and responsive layouts. Context matters. A hidden mobile menu is normal. A hidden block of casino links in the footer is not.
What to inspect
Check the rendered page and the source. Look for links with suspicious anchor text, links to unfamiliar hosts, and containers hidden by styles such as display none, visibility hidden, opacity zero, very small font sizes, or off-screen positioning.
Also check whether the hidden content appears across many pages. Site-wide hidden links often come from templates, injected widgets, compromised themes, or database content inserted into a footer area.
Cleanup
Remove the source of the links, then confirm that the public HTML no longer contains them. If the links came from a plugin, theme, or CMS user account, update or remove the weak point. If they came from a third-party script, review whether that script belongs on the site at all.
Monitor after cleanup
Hidden links can return when the same entry point remains open. Keep watching page source, sitemap signals, and suspicious external link patterns after the first cleanup.
Distinguish normal hidden UI from suspicious hidden content
Hidden content is not automatically bad. Navigation menus, tabs, modals, accordions, skip links, and accessibility helpers often hide content until a user interacts with the page. Suspicious hidden content usually has no clear user interface purpose and often contains unrelated commercial anchor text.
Context is the difference. A hidden "Menu" panel is normal. A hidden block of casino, loan, or pharma links at the bottom of every page is not.
Selector
footer .links-hidden
Style
font-size: 0; height: 0; overflow: hidden
Anchor text
Unrelated betting and loan terms
Where hidden links usually enter
They often come through compromised themes, footer widgets, injected CMS content, database options, old plugins, or third-party script snippets. In some cases they are added by a cheap SEO provider or an old affiliate script, not by an attacker. The cleanup is still the same: remove the source and confirm that public HTML is clean.
Use page templates to narrow the source
If the hidden links appear on every page, check layout templates, footer components, theme files, and global CMS options. If they appear only on blog posts, check post content, shortcodes, related-post plugins, and ad placements. If they appear only on one page, inspect that page record first.
What to check after removal
View source, not only the rendered page. Then clear application cache, CDN cache, and plugin cache. Check again from a private browser. Hidden links can survive in cached HTML after the source has been removed.
How to inspect without breaking the site
Start with read-only checks. View source, inspect the DOM, copy suspicious HTML, and identify the CSS that hides it. Do not delete theme files or database rows until you know where the content is generated. A hidden block in the final HTML may come from a database option, shortcode, widget, plugin, or cache layer.
If the site uses a page builder, check reusable templates, global footer blocks, custom HTML widgets, and tracking-code fields. These areas often inject content site-wide.
After removing hidden links
Clear caches, view the public HTML again, and check several page types. Then update weak plugins, remove unused themes, rotate admin passwords, and review editor accounts. Hidden links often return when cleanup removes the symptom but leaves the entry point.
How to remove hidden spam links
Copy the suspicious HTML and find where it is generated. Search the theme, plugin files, database, widgets, page builder templates, custom HTML blocks, and tag manager snippets for the anchor text or destination host. If the links appear after JavaScript runs, inspect loaded scripts and network requests.
Remove the source, not only the rendered output. If the links were injected into a database option or template, clean that location. If they came from a third-party script, remove the script and review why it was trusted. If they came from a compromised plugin, update or replace it and rotate admin credentials.
Hidden link cleanup
When to use Search Console
If hidden links were present for a while, review Search Console for strange indexed pages, manual actions, and unusual external links. Removing the links from your HTML is the priority, but search cleanup may still be needed if the links helped create spam pages or snippets.
Need a public content check? Ambastly's SEO spam checker looks at visible text, anchors, hidden-looking content, titles, metadata, and sitemap URLs.
Check for SEO spam signalsRelated guides
Keep investigating the same problem.
Google Shows Strange Pages for My Domain: How to Clean SEO Spam
If search results show strange pages, foreign text, casino terms, or pharma keywords for your domain, public SEO spam may be involved.
Read nextSitemap Contains Weird URLs: How to Remove Spam and Bad Paths
A sitemap with strange URLs can signal CMS trouble, plugin bugs, or SEO spam. Here is how to inspect it without making the problem worse.
Read nextWebsite Compromise Checklist: What to Check When a Site Looks Wrong
A practical first checklist for site owners when a website loads, but visitors, rankings, or public signals suggest something may be wrong.
Read next