Check 49.03 · User content and forums

Prevent user-generated spam

Keep spam out of forums, comments and profiles: moderation of new accounts, bot protection, rel ugc, noindex, monitoring and cleanup.

Priority
Important
Difficulty
Intermediate
Estimated time
2 hours to 1 day, then ongoing
Free, no account: your progress is saved in this browser.

Ask an AI to check this point on your site

Opens the assistant with a ready-made question: this check, its goal and your site URL.

For Gemini, Copilot or another assistant, copy the question. The link opens the chosen service directly: nothing goes through this site.

In short

User-generated spam is unwanted content posted by third parties in the open areas of a site: forum posts, comments, profiles, files. Google lists it among its spam policies, and the host site bears the consequences. Once this check is done, a suspicious contribution is not published unchecked, is not indexed and carries no followed links, and an attack is spotted within a few hours.

Why it matters

Spammers look for three things on a community site: links, indexed pages on an established domain, and traffic to divert. An open registration form is all it takes. Bots create accounts, fill the bio with a link, open threads about betting or medication, and the site ends up with thousands of pages it did not write.

Google's policies cite four examples: accounts created on hosts open to everyone, spam posts in forum threads, spam comments on blogs, spam files uploaded to a hosting platform. Forum signatures stuffed with optimized links, for their part, fall under link spam. A site in violation may rank lower or disappear from the results, and receive a manual action reported in Search Console. Hosting third-party contributions is not the issue: forums and comments are explicitly normal uses.

Generative engines also draw on discussions, but no provider documents how it filters out polluted threads.

What it improves

  • Risk of a manual action Greatly reduced; this is the main benefit.
  • Index quality Fewer worthless pages crawled and indexed, so crawl budget is better spent on large forums.
  • Trust of visitors and of serious contributors, who leave a forum that has been overrun.
  • Security Fewer links to phishing or malware pages, so fewer Safe Browsing warnings.
  • AI citations Indirect and unproven effect.

How to check

Search Google for what your site should not contain:

site:example.com casino OR viagra OR "sports betting" OR "payday loan"
site:example.com inurl:membres "http"
site:example.com/forum intitle:"watch" intitle:"streaming"

Adapt the words to your language and your industry. Then check:

curl -s https://example.com/forum/sujet-recent | grep -o -E '<a [^>]*href="https?://[^"]*"[^>]*>' | grep -v "example.com" | head

Compliant result: every external link posted by a member carries rel="ugc" or rel="nofollow".

In the database, look for accounts with no contributions whose profile contains a link.

How to implement

Before you start

Google recommends a layered defense. No single measure is enough.

Layer Measure Effect
Registration Email address verification, bot challenge, honeypot field, minimum time to fill in the form Stops simple bots
First contributions Pre-moderation of new accounts, limited number of links, rate limiting Stops manual spam and advanced bots
Content Blocklists (words, domains, IP addresses), a detection service such as Akismet Filters known campaigns
Links rel="ugc" or nofollow on links in contributions Removes the value of the link
Indexing noindex on the content and profiles of accounts with no reputation Removes the value of the page
Monitoring Volume alerts, reporting by members Detects what got through

Two principles:

The thresholds (number of posts to approve, links allowed, delays) are editorial choices: start strict, then relax based on what you observe.

Warning: bot challenges belong on forms and POST requests, never on page views. A challenge imposed on viewing also blocks crawlers: see check automatic blocking and CAPTCHAs (opens in a new tab).

Cleaning up after an attack

  1. Temporarily close registrations or switch them to manual approval.
  2. Identify the batch: time period, IP address ranges, email address domains, link domains.
  3. Delete the content and ban the accounts in bulk, with the software's own tool rather than an improvised SQL query.
  4. Make the deleted URLs return a 404 or 410 (opens in a new tab), with no redirect to the home page, and remove them from the sitemap.
  5. For the most embarrassing pages, use the Removals tool in Search Console, which hides them temporarily.
  6. In the event of a manual action, submit a reconsideration request after cleanup, describing the measures taken.
  7. Add the layer that was missing.

WordPress

Versions WordPress 6.4 to 7.1; Akismet 5; bbPress 2.6.

In Settings > Discussion:

  • check “Comment author must have a previously approved comment”, or “Comment must be manually approved”;
  • under “Comment Moderation”, hold in the queue comments that contain several links and list the words to moderate;
  • fill in “Disallowed Comment Keys” with the words and domains to reject outright;
  • automatically close comments on old posts;
  • uncheck “Allow link notifications from other blogs (pingbacks and trackbacks) on new posts” if you do not use them.

Activate Akismet (Settings > Akismet Anti-spam, API key required; the free plan is reserved for personal sites). Comment links natively carry rel="nofollow ugc".

bbPress relies on these same moderation lists and on Akismet when it is active. In Settings > Forums, leave posting by guests without an account disabled and set the minimum delay between two posts (“Flooding”). bbPress 2.6.21 and later add nofollow and ugc to links in topics and replies.

Discourse

Verified on Discourse 2026.11 (Admin > Settings). The protections are based on trust levels and are active by default:

Setting Default value Purpose
add rel nofollow to user content enabled nofollow on external links in posts
newuser max links 2 Links allowed per post for a new user
newuser spam host threshold 3 Flags a new user who repeats links to the same domain
rate limit new user create post 30 Seconds to wait between two posts by a new user
max topics in first day / max replies in first day 3 / 10 Caps for the first 24 hours
hide new user profiles enabled Hides from the public the profiles of accounts that have posted nothing
approve post count 0 Number of first posts to approve: raise it to 1 or 2 during an attack
approve unless allowed groups trust level 0 and above Groups exempt from approval

Profile pages are served with X-Robots-Tag: noindex, with nothing to configure. Round this out with the watched words (watched words) in the admin and, on a heavily exposed forum, the official Akismet plugin.

phpBB

Verified on phpBB 3.3.19, in the Administration Control Panel, General > Board configuration tab:

  • Spambot countermeasures: choose a plugin (custom question and answer, or reCAPTCHA) and enable it for guest posts as well;
  • User registration settings: Account activation by email or by an administrator; New member post limit keeps recent registrants in the Newly Registered Users group, from which you can remove the permission to post without approval;
  • Post settings: Flood interval and Maximum links per post.

Ban IP addresses, emails and usernames from the Users and Groups tab. phpBB 3.3 adds no rel attribute to links in posts: in a child style, change the url template in styles/prosilver/template/bbcode.html to <a href="{URL}" class="postlink" rel="ugc nofollow">, purge the cache, then also check automatically created links.

XenForo

According to the official manual (XenForo 2.3), in Setup > Options > Spam management:

  • at registration: lookup in the StopForumSpam database, DNS blacklists, minimum time to fill in the form;
  • on content: spam phrases applied to a member's first posts, and Akismet, which sends suspicious posts to the moderation queue;
  • CAPTCHA at registration and for guests;
  • Spam cleaner: deletes an account's posts in one action, bans it and reports it to StopForumSpam.

For the rel attribute of posted links, the manual does not state the rule: check the HTML with the command from “How to check”.

Laravel

Versions Laravel 11 to 13.

Limit the posting rate per user in app/Providers/AppServiceProvider.php:

use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;

public function boot(): void
{
    RateLimiter::for('contributions', function (Request $request) {
        return Limit::perMinutes(10, 5)->by($request->user()?->id ?: $request->ip());
    });
}
Route::post('/forum/{thread}/reponses', [RepliesController::class, 'store'])
    ->middleware(['auth', 'verified', 'throttle:contributions']);

On save, hold posts from accounts with no reputation for moderation (threshold of your choosing):

$reply = $thread->replies()->create([
    'user_id' => $request->user()->id,
    'body' => $request->validated('body'),
    'status' => $request->user()->approved_replies_count >= 3
        ? ReplyStatus::Published
        : ReplyStatus::Pending,
]);

Display and count only published posts. At render time, convert the Markdown without raw HTML or unsafe links: Str::markdown($reply->body, ['html_input' => 'strip', 'allow_unsafe_links' => false]), then add rel="ugc" as described in the guide linked above. For the registration form, the spatie/laravel-honeypot package adds a honeypot field and a minimum delay.

Server-side validation of a Turnstile token:

$response = Http::asForm()->post('https://challenges.cloudflare.com/turnstile/v0/siteverify', [
    'secret' => config('services.turnstile.secret'),
    'response' => $request->input('cf-turnstile-response'),
    'remoteip' => $request->ip(),
]);

abort_unless($response->json('success') === true, 422);

Symfony

Versions Symfony 6.4, 7.4 and 8.x.

Rate limiter, in config/packages/rate_limiter.yaml:

framework:
    rate_limiter:
        contributions:
            policy: 'sliding_window'
            limit: 5
            interval: '10 minutes'
public function store(Request $request, RateLimiterFactoryInterface $contributionsLimiter): Response
{
    $limiter = $contributionsLimiter->create($this->getUser()->getUserIdentifier());

    if (! $limiter->consume(1)->isAccepted()) {
        throw new TooManyRequestsHttpException();
    }

    // Save the post
}

RateLimiterFactoryInterface has existed since Symfony 7.3; in 6.4, inject RateLimiterFactory. Sanitize the HTML of contributions and force the rel attribute with the HtmlSanitizer component, in config/packages/html_sanitizer.yaml:

framework:
    html_sanitizer:
        sanitizers:
            app.ugc_sanitizer:
                allow_safe_elements: true
                allowed_link_schemes: ['http', 'https']
                force_attributes:
                    a:
                        rel: 'ugc nofollow'

In the template: {{ reply.body|sanitize_html('app.ugc_sanitizer') }}.

Cloudflare

Versions Cloudflare dashboard, all plans, November 2026.

Turnstile replaces a CAPTCHA on registration and posting forms. Create a widget in Turnstile (account menu), then add to the form:

<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>
<div class="cf-turnstile" data-sitekey="YOUR_SITE_KEY"></div>

The token sent in the cf-turnstile-response field must be validated on the server against the Siteverify API (example in the Laravel section): it is valid for only 300 seconds and only once. Without this validation, the widget protects nothing.

Custom rule: in Security > Security rules, create a rule with the Managed Challenge action, limited to form submissions:

(http.request.method eq "POST" and http.request.uri.path in {"/wp-comments-post.php" "/inscription" "/ucp.php"})

Rate limiting: in the same place, a rate limiting rule on the form's path. The Free plan provides a single rule, counted per IP address, over a 10-second period; higher plans allow longer periods and a filter on the method.

Common mistakes

  • Relying on rel="ugc" alone: the link loses its value, but the spam page stays published and indexable.
  • CAPTCHA on every page: crawlers and AI assistants are blocked along with the spammers.
  • Bot protection widget with no server-side validation: a bot submits the form without running the JavaScript.
  • Profiles public and indexable from registration, with an unrestricted bio and link.
  • Redirecting deleted spam threads to the home page instead of a 404 or 410.
  • Blocking spam pages with robots.txt: Google then sees neither their removal nor their noindex.
  • Old abandoned sections (guestbook, old articles) left open to posting.
  • Spam from the inside: do not buy or post artificial forum mentions (opens in a new tab) yourself.

Frequently asked questions

Can a site be penalized by Google for spam posted by its users?

Yes. User-generated spam is part of Google's spam policies, and it is the host site that is affected: pages ranked lower, removed from the results, or a manual action reported in Search Console. Google notes that owners are often unaware of the problem. After cleanup, a reconsideration request lets you have a manual action lifted.

Should posts from new members be set to noindex?

It is a measure Google recommends: add noindex to contributions from users with no reputation, then remove it once they have proved themselves. On a forum where every thread mixes several authors, the practical equivalent is to publish first posts only after approval, and to keep the profiles of recent accounts or accounts with no contributions in noindex.

How do I know if my forum has been spammed?

Run site: searches on your domain with typical spam terms, such as casino, medication or streaming, and look at the most recent profiles. In Search Console, watch the Page indexing report, unexpected queries in the Performance report, and the Manual actions and Security issues reports. A sudden rise in registrations or in pages created is the earliest signal.

Do Turnstile or reCAPTCHA block Googlebot?

No, if they are placed in the right spot. A bot challenge on a registration or posting form does not get in the way of Googlebot, which reads pages without submitting forms. The problem arises when a challenge or a firewall rule applies to page views: crawlers then receive a verification page instead of the content.

Updated on

Topic checklist (PDF)

And now?

In the “User content and forums” topic

  1. Mark up discussions with DiscussionForumPosting
  2. Mark up question-and-answer pages with QAPage
  3. Prevent user-generated spam
  4. Control the indexing of empty or thin threads
  5. Control the indexing of member profiles
  6. Handle the pagination of long threads
  7. Make contributions readable without JavaScript or login