Add pagination handling for archives

Paginated archives need crawlable anchor links, a self-referencing canonical on each page and a clear stop at the last page. rel=next and rel=prev are no longer used for indexing. Ensure new items get internal links and that page two is not blocked or redirected to page one.

mediumIn codeimpact effort

Why this matters

Make page two reachable, self-canonical and worth crawling.

Get the full breakdown

The extended brief explains when this works, when it does not, and the trade-offs. Join the waitlist and it unlocks for every tip when sign-in opens; MCP access is the paid part.

Join the waitlist

Before you start

  • A paginated listing template

How to apply it

  1. Check pagination links are crawlable General best practice

    Inspect the rendered HTML for the next-page control. It must be an anchor with an href; JavaScript-only controls hide deeper pages from crawlers.

    Check: The raw HTML of page one contains an anchor whose href points to page two.

  2. Self-canonicalize each page

    Each page in the sequence declares its own URL as canonical. Remove rules that point page two and beyond at page one.

    Check: curl -s your production domain/blog?page=2 contains a canonical equal to the page-two URL.

  3. Bound the sequence

    Stop pagination after the last real page and return 404 for page numbers beyond it. Keep the URL pattern consistent.

    Check: A page number beyond the last returns 404, and the last page has no next link.

Get the prompt for your agent

A ready-to-paste prompt for your agent that implements this tip and verifies the result in your repo.

Join the waitlist

Source: seo-mcp playbook · curated entry · report an error

Framework notes

nextjs-app

Use `searchParams` for `?page=` and set `alternates.canonical` per page value in `generateMetadata`; render pagination with `<Link>`.

wordpress

Use `paginate_links()` which outputs anchors, and disable canonical redirection plugins that force archive pages to the first page.

Official references

Let your agent apply this + 161 more tips.

Pre-order — $19