---
title: "Hiding text or links from visitors · Agent Wranglers"
url: https://agentwranglers.se/playbook/seo/search-spam-and-penalties/hidden-text
id: SEO-52
level: Avoid
updated: 2026-10-22
tokens: 979
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Hiding text or links from visitors

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Search spam and penalties](https://agentwranglers.se/playbook/seo/search-spam-and-penalties.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-22.

- ID: SEO-52
- Level: Avoid
- Chapter: [Search spam and penalties](https://agentwranglers.se/playbook/seo/search-spam-and-penalties.md)
- Rule: Text or links placed for search engines that visitors cannot see. Examples are text in the background colour, text behind an image or off screen, text of zero size, and a link on one character.
- Check: A browser test visits each page type. No text in the main content has a font size of 0, an opacity of 0, its background's colour or a place off the page. Screen-reader-only text and closed `<details>`, tabs and `hidden="until-found"` elements are exempt.
- How: Google's spam policies list each of these as hidden text and link abuse. They also say content in accordions, tabs, tooltips and sliders is fine, and so is text only screen readers hear. The test is intent. Text hidden from people to feed search engines breaks the policy. Text folded away for the reader's sake does not. Fold text as [Let find-in-page open hidden text](https://agentwranglers.se/playbook/accessibility/structure-and-names/hidden-until-found.md) says.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### JavaScript example

```js
const hidden = await page.$$eval('main *', elements => elements.filter(element => {
  const style = getComputedStyle(element);
  const box = element.getBoundingClientRect();
  return element.childNodes.length && element.textContent.trim() && !element.closest('.sr-only, details:not([open]), [hidden]')
    && (style.fontSize === '0px' || style.opacity === '0' || style.color === style.backgroundColor || box.right < 0 || box.bottom < 0);
}).map(element => element.textContent.trim().slice(0, 40)));
assert.deepEqual(hidden, []);
```

### Python example

```python
hidden = page.eval_on_selector_all("main *", """elements => elements.filter(element => {
  const style = getComputedStyle(element), box = element.getBoundingClientRect();
  return element.textContent.trim() && !element.closest('.sr-only, details:not([open]), [hidden]')
    && (style.fontSize === '0px' || style.opacity === '0' || style.color === style.backgroundColor || box.right < 0 || box.bottom < 0);
}).map(element => element.textContent.trim().slice(0, 40))""")
assert hidden == []
```

## Sources

- [Google Search Central – Spam policies, hidden text and link abuse](https://developers.google.com/search/docs/essentials/spam-policies)

## Related rules

- AXS-26 [Let find-in-page open hidden text](https://agentwranglers.se/playbook/accessibility/structure-and-names/hidden-until-found.md) in Accessibility
- SEO-75 [Planting instructions for AI models](https://agentwranglers.se/playbook/seo/ai-search-answers/prompt-injection-content.md) in SEO

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/seo/search-spam-and-penalties/hidden-text">Agent Wranglers SEO playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Repeating keywords to rank](https://agentwranglers.se/playbook/seo/search-spam-and-penalties/keyword-stuffing.md)
- Next: [Showing crawlers a different page](https://agentwranglers.se/playbook/seo/search-spam-and-penalties/cloaking.md)
- [Search spam and penalties](https://agentwranglers.se/playbook/seo/search-spam-and-penalties.md)
