Blog

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.

Hidden link review example

Selector

footer .links-hidden

Hidden block

Style

font-size: 0; height: 0; overflow: hidden

Suspicious

Anchor text

Unrelated betting and loan terms

Spam signal

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.

SEO note: hidden spam links can damage trust even if visitors never see them. Search engines can still parse the HTML and treat the page as manipulated.

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

LocateFind whether links come from page content, global templates, widgets, plugins, injected scripts, or cached HTML.
RemoveDelete the source and clear every cache layer before checking again.
HardenUpdate CMS components, remove unused plugins, review admin users, and rotate credentials.
ConfirmView source on multiple page types and check sitemap URLs for related spam pages.

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 signals

Related guides

Keep investigating the same problem.

All guides