How should you handle pagination for SEO?
guide // , 5 min read, by Darthwares
Pagination divides a long list of items or articles into multiple sequential pages, such as "Page 1," "Page 2," and "Page 3." For search engine optimization (SEO), the goal is to ensure that each of these pages is discoverable and understood by search engines as part of a larger, ordered list. This involves using canonical URLs to manage similar content and structured data to provide context about the list's structure.
On this page // 5 sections
The short version
- Each paginated page should generally have a self-referential canonical URL.
- Google identifies the best version of a page if no canonical is specified.
- Use HTML to set canonical URLs; if using JavaScript, ensure consistency.
- Employ ItemList structured data to describe multi-page lists and their order.
- Avoid conflicting canonical signals across different methods.
What is pagination in SEO?
Pagination refers to the practice of splitting content, often a long list of items like products or articles, across several distinct web pages. For example, a category page showing 100 products might be divided into 10 pages, each displaying 10 products. From an SEO perspective, this creates multiple pages with similar content, which search engines need to understand and process efficiently.
Google aims to identify the most representative version of a page to show in search results. If you do not explicitly tell Google which URL is the preferred or "canonical" version, Google will determine which version of the URL is objectively the best to show to users. This process helps Google consolidate signals from similar pages.
When you include pages in a sitemap, you are suggesting them as canonicals. Google then evaluates these pages, along with others it discovers, to decide if any are duplicates based on their content similarity. This means that even paginated pages, when listed in a sitemap, are considered as potential canonical versions of content.
How do canonical URLs work for paginated content?
Canonical URLs are a way to tell search engines which version of a page is the primary one when multiple pages have identical or very similar content. For paginated content, each page in the sequence (e.g., example.com/category?page=1, example.com/category?page=2) is typically considered a distinct page, not a duplicate of the first page. Therefore, each paginated page should generally declare itself as its own canonical.
Google documents that the rel="canonical" link annotation is a strong signal for specifying a canonical URL. This link element must appear within the <head> section of the HTML document to be accepted. A best practice is to include a self-referential rel="canonical" link on the canonical page itself. This means example.com/category?page=2 would have a canonical tag pointing to example.com/category?page=2.
It is important to avoid sending conflicting signals about canonical URLs. For instance, do not specify one URL as canonical in a sitemap while using a different URL for that same page with a rel="canonical" tag. If you do not specify a canonical URL, Google will identify the best version to show in search results. Furthermore, Google prefers HTTPS pages over equivalent HTTP pages as canonical, unless there are issues like an invalid SSL certificate on the HTTPS page.
Can JavaScript set canonical URLs?
Modern web applications often use JavaScript to render content and manage routing, including paginated lists. Google processes JavaScript-powered web applications in three main phases: crawling, rendering, and indexing. This means that content and elements, including canonical tags, that are injected or modified by JavaScript can be discovered and understood by Google Search. The rel="canonical" link tag helps Google find the canonical version of a page, regardless of how it is set.
While it is possible to use JavaScript to set the canonical URL, Google states that the best way to do this is by including the rel="canonical" link directly in the HTML. If you must use JavaScript to set the canonical URL, ensure that it always sets the canonical URL to the same value as the original HTML. It is crucial not to use JavaScript to change the canonical URL to something different from what was specified in the initial HTML.
When JavaScript is used to inject the rel="canonical" link tag, it must be the only rel="canonical" link tag on the page. Having conflicting or multiple rel="canonical" link tags can lead to unexpected results and confuse search engines about which page is the true canonical. Additionally, when using client-side rendering and routing, a JavaScript redirect to a URL that responds with a 404 HTTP status code, such as /not-found, can help avoid soft 404 errors.
How can structured data help with paginated lists?
Structured data provides search engines with explicit information about the content on a page, helping them understand its context and relationships. For paginated lists, the ItemList Schema.org type is relevant. This type is used to describe a list of items of any sort, such as "Top 10 Movies About Weathermen" or "Top 100 Party Songs," and is widely adopted across millions of domains.
When marking up an ItemList, you can specify the items within the list using itemListElement. These elements can be simple strings, existing entities, or ListItem objects. For ordered lists, especially those that span multiple pages, using ListItem is beneficial. ListItem allows you to provide additional context about an element in the list or when the same item might appear in different places across various lists.
It is important to note that the order of elements in your HTML markup alone is not sufficient to indicate the intended order of items in a list. To explicitly define the order, you should use ListItem with a position property for each item. Furthermore, for multi-page pagination, the numberOfItems property within the ItemList should represent the total count of items across the entire list, not just those on the current page.
Common questions
What happens if I don't specify a canonical URL for my paginated pages?
If you do not specify a canonical URL, Google will identify which version of the URL is objectively the best to show to users in Search, based on its content and other signals.
Where should the rel="canonical" link element be placed?
The rel="canonical" link element is only accepted if it appears in the <head> section of the HTML document. Ensure that at least the <head> section is valid HTML.
Can I use JavaScript to change a canonical URL that was set in HTML?
You should not use JavaScript to change the canonical URL to something different from the URL you specified as the canonical URL in the original HTML. The best way to set the canonical URL is using HTML.
How do I indicate the order of items in a paginated list using structured data?
The order of elements in your markup is not sufficient. Use ListItem with a position property for each item to explicitly indicate its order within the list.
Does Google prefer HTTPS or HTTP pages for canonicals?
Google prefers HTTPS pages over equivalent HTTP pages as canonical, unless there are issues or conflicting signals, such as an invalid SSL certificate on the HTTPS page.
Primary sources and further reading
This article was researched and written by an AI model and published automatically. It was written from sentences that were checked to appear on the pages below, but a person has not reviewed the text. If something is wrong, tell us at chibivikramathithan@darthwares.com and we will correct it.