Pagination: link rel=”prev” and rel=”next”

What you can expect from this article

Pagination attributes are used to indicate the relations between a sequence of pages to search engines. This helps search engines to understand a series of related pages and is used to prevent duplicate content issues.In this article we’re going to explore how to use these attributes.

What are the rel=next and rel=prev attributes?

The rel=”next” and rel=”prev” link attributes are used to indicate the relations between a sequence of pages to search engines.

Often, these are incorrectly called the rel=”next” and rel=”prev” tags. For the sake brevity, we’ll call the rel=”next” and rel=”prev” attributes pagination attributes.

The pagination attributes are placed in the <head> section of your HTML pages and look like this:

<link rel=”prev” href=”http://www.example.com/page-2.html”>
<link rel=”next” href=”http://www.example.com/page-4.html”>

When should I use the pagination attributes?

A very common use-case for pagination attributes are category pages on ecommerce websites. Usually category pages contain many different products and are therefore split across multiple pages, each page showing a subset of category.

Using the pagination attributes
Using the pagination attributes

A downside of this is that these pages are look very similar, leading to duplicate content. By making the relations between a series of pages clear to search engines using the pagination attributes, you give search engines context and prevent duplicate content.

How to implement the pagination attributes

Example
You have a sequence of three pages, this is what the definition of pagination and the canonical URL looks like:

Page 1 references the next page:

<link rel=”next” href=”http://www.example.com/page-2.html”>
<link rel=”canonical” href=”http://www.example.com/page-1.html”/>

Page 2 references the first page and the next page:

<link rel=”prev” href=”http://www.example.com/page-1.html”>
<link rel=”next” href=”http://www.example.com/page-3.html”>
<link rel=”canonical” href=”http://www.example.com/page-2.html”/>

Page 3 only has a reference to the previous page (and the definition of the canonical URL) since it’s the last one in the sequence:

<link rel=”prev” href=”http://www.example.com/page-2.html”>
<link rel=”canonical” href=”http://www.example.com/page-3.html”/>

Best practices for the pagination attributes

Stick to the best practices below to make pagination work for you.

Self referencing canonical URL

Implementation of the pagination attributes
Implementation of the pagination attributes

Each page in the sequence of pages should have a canonical URL that points to itself.

So on page 2 of the sequence, your <head> section may look like this:

<link rel=”prev” href=”http://www.example.com/page-1.html”>
<link rel=”next” href=”http://www.example.com/page-3.html”>
<link rel=”canonical” href=”http://www.example.com/page-2.html”/>

Don’t break the sequence

Don’t break the sequence of pages. If you do, search engines will often ignore the pagination and just index and return all pages, leading to potential duplicate content issues.

A simple example what would break the sequence of pages: forgetting the rel=”prev” reference from page 2 to the first page.

Avoid redirects

Avoid having pagination attributes and canonical URL references URLs that in turn redirect to other pages. This is confusing for search engines.

Use absolute URLs

Even though it’s not against the specification of the link tag, the general consensus is not to use relative URLs when defining pagination attributes. Relative URLs are more likely to be interpreted wrong by search engines. The same best practice applies to other uses of the link tag: canonical URL, hreflang attribute and mobile attribute.

Frequently asked questions about pagination attributes

  1. Why do search engines ignore my pagination attributes?
  2. Can I also use rel=”previous” instead of rel=”prev”?
  3. Will my paginated pages be indexed by search engines?

1. Why do search engines ignore my pagination attributes?

The rel=”next” and rel=”prev” attributes are signals rather than directives. Search engines are not required to actually follow your definition of pagination attributes, but they usually do.

2. Can I also use rel=”previous” instead of rel=”prev”?

Yes, both work but we prefer rel=”prev” for the sake of brevity.

3. Will my paginated pages be indexed by search engines?

Yes, but usually they won’t show up in the search engine result pages as in most cases search engines return the first page in the sequence. However in cases where there’s unique content on one of the paginated pages that page may show up in the search engine result as well.

Resources

  1. Google guidelines

Ready to try ContentKing?

Finally understand what’s really happening on your website.
Please enter a valid domain name (www.example.com).