---
title: "Keep spam in user posts out of search · Agent Wranglers"
url: https://agentwranglers.se/playbook/seo/search-spam-and-penalties/user-generated-spam
id: SEO-79
level: Recommended
applies: accounts
updated: 2026-10-22
build: a2a6bdfed830
tokens: 1001
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Keep spam in user posts out of search

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-79
- Level: Recommended
- Chapter: [Search spam and penalties](https://agentwranglers.se/playbook/seo/search-spam-and-penalties.md)
- Rule: Keep posts and profile pages from new or unreviewed users `noindex` until they pass moderation and the account earns trust. Mark every link in them `rel="ugc nofollow"`.
- Check: A test signs up a new account, posts a reply with a link and opens its public page. The page carries `noindex` and the link carries `rel="ugc nofollow"`. Once the account meets the trust rule and the post is approved, the page has no `noindex`.
- Applies when: The project has user accounts.
- How: Spammers post comments, forum threads, reviews and profile pages to get their links and pages into search. Google's guide to preventing user-generated spam asks for six defences. They are an abuse policy shown at sign-up, moderation, `ugc` or `nofollow` on links, `noindex` on posts from new users, blocklists and a human check. Define trust in code, such as an account older than 30 days with three approved posts. Profile pages with no posts stay `noindex`. Block repeat spammers and challenge risky sign-ups, as [Stop spam and fake sign-ups](https://agentwranglers.se/playbook/trust-and-safety/sign-up-fraud-and-abuse/sign-up-risk-score.md) says. Render link attributes as [Mark links you do not vouch for](https://agentwranglers.se/playbook/seo/links-from-other-sites/user-link-attributes.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 DAY_MS = 86_400_000
const TRUSTED_AFTER_DAYS = 30
const TRUSTED_AFTER_APPROVED_POSTS = 3

const isTrusted = (author, now = Date.now()) =>
  now - author.createdAt >= TRUSTED_AFTER_DAYS * DAY_MS && author.approvedPosts >= TRUSTED_AFTER_APPROVED_POSTS

export const robotsFor = post => (post.approved && isTrusted(post.author) ? null : 'noindex')
```

### Python example

```python
from datetime import datetime, timedelta, timezone

TRUSTED_AFTER = timedelta(days=30)
TRUSTED_AFTER_APPROVED_POSTS = 3

def is_trusted(author, now=None):
    now = now or datetime.now(timezone.utc)
    return now - author.created_at >= TRUSTED_AFTER and author.approved_posts >= TRUSTED_AFTER_APPROVED_POSTS

def robots_for(post):
    return None if post.approved and is_trusted(post.author) else "noindex"
```

## Sources

- [Google Search Central – Prevent user-generated spam](https://developers.google.com/search/docs/monitor-debug/prevent-abuse)
- [Google Search Central – Spam policies](https://developers.google.com/search/docs/essentials/spam-policies)

## Related rules

- TNS-11 [Score every sign-up for risk](https://agentwranglers.se/playbook/trust-and-safety/sign-up-fraud-and-abuse/sign-up-risk-score.md) in Trust and safety
- SEO-20 [Mark links you do not vouch for](https://agentwranglers.se/playbook/seo/links-from-other-sites/user-link-attributes.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/user-generated-spam">Agent Wranglers SEO playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Taking over the back button](https://agentwranglers.se/playbook/seo/search-spam-and-penalties/back-button-hijacking.md)
- [Search spam and penalties](https://agentwranglers.se/playbook/seo/search-spam-and-penalties.md)
