Agent Wranglers

SEO-79Recommended

Keep spam in user posts out of search

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".

How to do it

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 says. Render link attributes as Mark links you do not vouch for says.

Examples

JavaScript example

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

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"

How to 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.

Sources

For agents: this playbook is free to use under CC 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.