In short
A thread with 400 replies does not fit on one page: it is split into pages of a few dozen posts. Each page needs its own URL, a canonical that points to itself, <a href> links to the other pages and a title that sets it apart. Each post also keeps a stable address, even as the thread grows. Once this check is done, the useful answer posted on page 7 is crawlable, indexable and citable with a link that leads to the right place.
Why it matters
On a forum, the value is often a long way from the first post: the solution arrives in the twelfth reply, the hands-on feedback in the hundredth. Yet pages 2 and beyond are the ones implementations neglect.
Google's documentation on pagination sets out the rules:
- each page has a unique URL; a fragment (
#page=2) is ignored; - each page links to the next one with
<a href>; - the first page does not serve as the canonical for the series: each page has its own;
rel="next"andrel="prev"are no longer used by Google, but other search engines may still use them.
A canonical from every page to page 1 is the most costly mistake: it asks Google to ignore the replies on the following pages, even though their content is not on page 1.
On the Bing side, the only official source found is a 2012 blog post that presents rel="next" and rel="prev" as optional hints about the structure of a series. Keeping them costs nothing; neither does dropping them, as long as the visible links exist.
The second issue is the address of a post. A ?page=7#message-131 link stops being right if the number of posts per page changes or if posts are deleted. A permalink based on the post ID, which redirects to the right page, stays valid.
The general principle for paginated lists (categories, blogs) is covered in controlling pagination and infinite scroll (opens in a new tab); this guide only covers what is specific to threads.
What it improves
- Indexing of deep replies Pages 2 and beyond can answer specific queries that page 1 does not cover.
- Crawling Links to several pages (1, 2, 3 … 12), and not just “Next”, shorten the path to the end of the thread.
- Citations An AI assistant or another site can point to a specific post with a durable link. No citation is guaranteed.
- Performance Reasonably sized pages limit the weight of the HTML and the size of the DOM.
- Rankings Pagination has no direct effect; the effect comes from what it makes indexable.
How to check
Take a thread with at least three pages.
Does page 2 point to itself?
curl -s "https://example.com/discussions/panne-chaudiere?page=2" | grep -iE '<title>|rel="canonical"|name="robots"'
Compliant: a canonical to …?page=2, no noindex, and a title that mentions the page.
Are the pagination links in the HTML?
curl -s "https://example.com/discussions/panne-chaudiere" | grep -oE '<a [^>]*href="[^"]*page[=/-][0-9]+[^"]*"' | head
Is an out-of-range page handled?
curl -s -o /dev/null -w "%{http_code} %{redirect_url}\n" "https://example.com/discussions/panne-chaudiere?page=9999"
Compliant: 404, or a 301 redirect to the last page. Never an empty 200. See avoiding infinite URL spaces (opens in a new tab).
Does a post's permalink lead to the right place? Open the date link or “#” link of a post on page 3: the URL must either redirect to the page that contains it or carry a canonical to that page.
Does Google see the page? Run the URL of page 2 through URL Inspection in Search Console and compare “User-declared canonical” and “Google-selected canonical”.
How to implement
Before you start
Six decisions apply to every environment:
- Ascending chronological order. Page 1 always contains the same posts; new ones are added at the end. A reversed order shifts every post from one page to the next with each reply.
- One URL per page, page 1 without a parameter.
/discussions/panne-chaudierethen?page=2;?page=1redirects to the bare URL. - Self-referencing canonical on each page, and no
noindexon the following pages. - Distinct title. Google accepts identical titles within a series; adding “Page 2” is still a useful editorial choice for finding your way around the search results and the reports. See writing a unique title for each important page (opens in a new tab).
- One permalink per post, based on its ID:
/messages/131returns a 301 redirect to…?page=7#message-131, and each post carriesid="message-131". - Page size. Search engines recommend no particular number. As a guide, bbPress displays 15 replies per page by default and Discourse serves 20 posts per page to crawlers; above 50, keep an eye on the weight of the HTML and on DOM complexity (opens in a new tab). Avoid changing this setting once the forum is indexed: the content of every page URL changes.
Reference markup for page 2:
<head>
<title>Boiler fails to start, page 2 | Example Forum</title>
<link rel="canonical" href="https://example.com/discussions/panne-chaudiere?page=2">
<link rel="prev" href="https://example.com/discussions/panne-chaudiere">
<link rel="next" href="https://example.com/discussions/panne-chaudiere?page=3">
</head>
<article id="message-21">
<a href="/messages/21">12 March 2026, 2:02 pm</a>
…
</article>
<nav aria-label="Discussion pages">
<a href="/discussions/panne-chaudiere">1</a>
<a href="/discussions/panne-chaudiere?page=2" aria-current="page">2</a>
<a href="/discussions/panne-chaudiere?page=3">3</a>
<a href="/discussions/panne-chaudiere?page=12">12</a>
<a href="/discussions/panne-chaudiere?page=3">Next</a>
</nav>
Structured data on pages 2 and beyond. Google's “Discussion forum” documentation states that, in a multi-page thread, the url property of the original post takes the URL of the first page, and that the following pages ideally include this original post with that URL. The text of the original post is then not required; the comment items are the replies present on the current page:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"url": "https://example.com/discussions/panne-chaudiere",
"headline": "Boiler fails to start",
"datePublished": "2026-03-10T08:15:00+01:00",
"author": { "@type": "Person", "name": "lucie_r", "url": "https://example.com/membres/lucie_r" },
"commentCount": 231,
"comment": [
{
"@type": "Comment",
"url": "https://example.com/messages/21",
"datePublished": "2026-03-12T14:02:00+01:00",
"author": { "@type": "Person", "name": "marc_chauffage", "url": "https://example.com/membres/marc_chauffage" },
"text": "Full text of the reply, as displayed on this page."
}
]
}
</script>
The full markup is described in marking up discussions with DiscussionForumPosting (opens in a new tab); for a question-and-answer site, see QAPage (opens in a new tab).
Infinite scroll. It is acceptable if the ?page=n pages exist, work without JavaScript and are linked in the HTML; the script merely chains these pages together and updates the URL with the History API. The code is given in the pagination guide mentioned above.
Discourse
Checked on Discourse 2026.12 (official forum). There is nothing to configure. Visitors get infinite scroll; the HTML served to crawlers and to browsers without JavaScript is paginated as ?page=2 in batches of 20 posts, with a self-referencing canonical, rel="prev" and rel="next" tags, a title suffixed with “Page 2” and DiscussionForumPosting markup in microdata. A post's URL (/t/titre/30/45) carries a canonical to the page that contains it, and an out-of-range page returns a 301 redirect to the last one. Just check that a theme or plugin does not alter this behavior:
curl -s -A "Googlebot" "https://forum.example.com/t/titre/30?page=2" | grep -iE '<title>|rel="(canonical|prev|next)"'
phpBB
Checked in the 3.3 branch code (version 3.3.19). The pages of a topic have URLs of the form viewtopic.php?t=12&start=20, where start is the position of the first post. phpBB outputs a canonical that keeps start and adds the page number to the title. A post's link (viewtopic.php?p=345#p345) gets the canonical of the page that contains it. The number of posts per page is set in the Administration Control Panel (“Posts per page” in “Post settings”, posts_per_page option). If a URL rewriting extension is installed, check that it keeps one canonical per page.
XenForo
2.3 branch; the official manual could not be consulted without logging in at the time of writing, so check each point with curl. The pages of a thread have a path-based URL (/threads/titre.123/page-2) and each post has a permalink based on its ID. The number of posts per page is a global option in the admin control panel (“Messages per page”). On page 2, check the canonical, the title and the presence of DiscussionForumPosting markup.
WordPress
Versions WordPress 6.4 and later (checked up to 7.1); bbPress 2.6.
Native comments
Settings > Discussion > Break comments into pages creates /article/comment-page-2/ URLs. WordPress gives them a self-referencing canonical. Three precautions:
- each comment page repeats the entire post: only paginate posts that really exceed the threshold, and keep the threshold high (50 top-level comments by default);
- choose “the first page displayed by default”, otherwise the post's URL shows the last page and its content changes with every comment;
- the native title does not mention the comment page. To add it:
add_filter('document_title_parts', function (array $parts): array {
$page = (int) get_query_var('cpage');
if ($page >= 2) {
$parts['page'] = sprintf('Comments, page %d', $page);
}
return $parts;
});
An SEO plugin may replace this title: check the result in the source code.
bbPress
Topics are paginated as /forums/topic/titre/page/2/, with 15 replies per page by default (Settings > Forums). Check the canonical of page 2 with curl. If it points to page 1, fix it:
add_filter('get_canonical_url', function (string $canonical, WP_Post $post): string {
if (! function_exists('bbp_is_single_topic') || ! bbp_is_single_topic()) {
return $canonical;
}
$page = (int) get_query_var('paged');
if ($page < 2) {
return $canonical;
}
return trailingslashit(get_permalink($post)) . user_trailingslashit(bbp_get_paged_slug() . "/{$page}", 'paged');
}, 10, 2);
Laravel
Versions Laravel 11 to 13.
// app/Http/Controllers/ThreadsController.php
public function show(Thread $thread): View
{
$posts = $thread->posts()->oldest('id')->with('author')->paginate(20);
abort_if($posts->currentPage() > $posts->lastPage(), 404);
return view('threads.show', ['thread' => $thread, 'posts' => $posts]);
}
// app/Http/Controllers/PostsController.php: permalink /messages/{post}
public function show(Post $post): RedirectResponse
{
$position = $post->thread->posts()->where('id', '<=', $post->id)->count();
$page = (int) ceil($position / 20);
$url = route('threads.show', $post->thread);
if ($page > 1) {
$url = "{$url}?page={$page}";
}
return redirect()->to("{$url}#message-{$post->id}", 301);
}
@php
$page = $posts->currentPage();
$canonical = $page > 1 ? $posts->url($page) : route('threads.show', $thread);
@endphp
<title>{{ $thread->title }}{{ $page > 1 ? ", page {$page}" : '' }} | Example Forum</title>
<link rel="canonical" href="{{ $canonical }}">
…
{{ $posts->links() }}
Also redirect ?page=1 to the bare URL. paginate() produces links to several pages; simplePaginate() and cursorPaginate() only offer “Previous” and “Next”, and the latter has no stable page number.
Symfony
Versions Symfony 6.4, 7.4 and 8.x.
// src/Controller/ThreadController.php
#[Route('/discussions/{slug}', name: 'thread_show')]
public function show(
#[MapEntity(mapping: ['slug' => 'slug'])] Thread $thread,
#[MapQueryParameter] int $page = 1,
): Response {
$perPage = 20;
$query = $this->posts->createQueryBuilder('p')
->andWhere('p.thread = :thread')->setParameter('thread', $thread)
->orderBy('p.id', 'ASC')
->setFirstResult(($page - 1) * $perPage)
->setMaxResults($perPage);
$posts = new Paginator($query);
$lastPage = max(1, (int) ceil(count($posts) / $perPage));
if ($page < 1 || $page > $lastPage) {
throw $this->createNotFoundException();
}
return $this->render('thread/show.html.twig', [
'thread' => $thread,
'posts' => $posts,
'page' => $page,
'lastPage' => $lastPage,
]);
}
{% set params = page > 1 ? {slug: thread.slug, page: page} : {slug: thread.slug} %}
<title>{{ thread.title }}{{ page > 1 ? ', page ' ~ page : '' }} | Example Forum</title>
<link rel="canonical" href="{{ url('thread_show', params) }}">
Paginator is the one from Doctrine\ORM\Tools\Pagination. Generate the pagination links with path('thread_show', …) in real <a> tags.
Next.js
Versions Next.js 15 and 16 (App Router).
// app/discussions/[slug]/page.tsx
import type { Metadata } from 'next';
type Props = {
params: Promise<{ slug: string }>;
searchParams: Promise<{ page?: string }>;
};
export async function generateMetadata({ params, searchParams }: Props): Promise<Metadata> {
const { slug } = await params;
const page = Number((await searchParams).page ?? 1);
const thread = await getThread(slug);
if (!thread) {
return {};
}
return {
title: page > 1 ? `${thread.title}, page ${page}` : thread.title,
alternates: { canonical: page > 1 ? `/discussions/${slug}?page=${page}` : `/discussions/${slug}` },
};
}
The page component reads page in the same way, calls notFound() beyond the last page and renders the pagination with <Link>, as in the guide on list pagination. A post's permalink is a route handler (app/messages/[id]/route.ts) that works out the page and calls permanentRedirect(). Keep the list of posts in a server component: see making contributions readable without JavaScript (opens in a new tab).
Nuxt
Versions Nuxt 3 and 4.
<!-- pages/discussions/[slug].vue -->
<script setup lang="ts">
const route = useRoute();
const slug = route.params.slug as string;
const page = computed(() => Number(route.query.page ?? 1));
const { data } = await useAsyncData(
() => `thread-${slug}-${page.value}`,
() => $fetch(`/api/threads/${slug}`, { query: { page: page.value } }),
{ watch: [page] },
);
if (!data.value || page.value > data.value.lastPage) {
throw createError({ statusCode: 404, fatal: true });
}
const path = computed(() => (page.value > 1 ? `/discussions/${slug}?page=${page.value}` : `/discussions/${slug}`));
useHead({
title: () => (page.value > 1 ? `${data.value?.title}, page ${page.value}` : data.value?.title),
link: [{ rel: 'canonical', href: () => `https://example.com${path.value}` }],
});
</script>
<template>
<article v-for="post in data?.posts" :id="`message-${post.id}`" :key="post.id" v-html="post.html" />
<nav aria-label="Discussion pages">
<NuxtLink v-for="n in data?.lastPage" :key="n" :to="n > 1 ? `/discussions/${slug}?page=${n}` : `/discussions/${slug}`">{{ n }}</NuxtLink>
</nav>
</template>
useAsyncData runs during server rendering: the posts and the links are in the initial HTML. post.html must have been sanitized on the server before being passed to v-html.
Common mistakes
- A canonical from every page to page 1: the replies on the following pages drop out of the index.
noindexon pages 2 and beyond: same effect, their replies drop out of the index.- Pagination by fragment (
#page-2) or by a button with nohref: crawlers only see one page. - Last page displayed by default on the thread's URL: the content of the main URL changes with every reply.
- Changing the number of posts per page on an established forum: every indexed page changes content and deep links shift, unless permalinks go through the post ID.
- Hard-coding
?page=7#message-131links to posts in notifications, quotes and markup, instead of the permalink. - Offering only “Previous” and “Next”: page 40 is 39 clicks away from the first.
Frequently asked questions
Should every page of a thread have a canonical to page 1?
No. Google explicitly asks you not to use the first page of a paginated series as the canonical for the following ones. Each page of a thread contains different replies: a canonical to page 1 amounts to asking search engines to ignore them. Each page carries a canonical to its own URL, and page 1 to the thread's URL without a parameter.
Are the rel="next" and rel="prev" tags still useful?
Google has stopped using rel="next" and rel="prev" and says so in its pagination documentation, adding that other search engines may still use them. Bing described them in 2012 as optional hints. You can therefore leave them in place if your software outputs them, but they replace neither visible links between pages nor a correct canonical.
How many posts should a discussion thread show per page?
No search engine recommends a number of posts per page. As a guide, bbPress displays 15 by default and Discourse serves 20 per page to crawlers, which keeps pages light. A higher number reduces the number of pages to crawl but makes the HTML and the DOM heavier. Choose a value, measure the weight of long pages, then leave it alone.
What should the DiscussionForumPosting markup contain on page 2 of a thread?
On page 2 of a thread, Google recommends including the original post with the address of the first page in its url property. The text of that post is then not required. The comment items describe the replies actually displayed on the current page, with their full text, author and date. Do not declare replies that appear on other pages.
Resources
- Google Search Central: pagination best practicesdevelopers.google.com
- Google Search Central: discussion forum structured datadevelopers.google.com
- Google Search Central: fix lazy-loaded contentdevelopers.google.com
- Bing Webmaster Blog: markup for paginated content (2012)blogs.bing.com
- phpBB: viewtopic.php code, 3.3 branchgithub.com
- WordPress: wp_get_canonical_url functiondeveloper.wordpress.org
- Laravel: paginationlaravel.com
- Doctrine ORM: paginationdoctrine-project.org
Updated on
Topic checklist (PDF)