
Along with the use of the
rel = “canonical” attribute to indicate to the search bot to duplicate content, it is now possible to use the value rel = “next” and rel = “prev” for HTML links to indicate the position of the current page in relation to neighboring pages within the navigation block. Within the web, there are various options for using page-by-page navigation - an article divided into several pages, or a category of products distributed over several pages, or a forum thread divided into a sequence of URLs. Now, by including rel = “next” and rel = “prev” in the layout of pages, we can specify Google:
- Create a consolidated page index so that links are not scattered between individual pages page-1.html, page-2.html, and so on
- When searching, direct the user to the most relevant page among all others, for example, to the beginning of an article divided into several pages.
There is an exception when using rel = “next | prev” if you have implemented the “Show all” page, on which, for example, all products of the category are shown without pagination. In that case, please read
these recommendations .
Due to the fact that the “Show All” page is most often preferred by users, we are doing everything possible so that it’s the search results that participate, rather than individual pages (marked up using rel = “next | prev”). If there is no such page in the structure of your site, you can safely use the rel attribute as described above.
Your actions
Here are three options:
- Let it be as it is. Multi-page content is found all over the Internet, and Google will continue to make every effort to find the best result for the user, regardless of whether you use the rel attribute or not.
- If you have a “Show All” page, take a look at our recommendations .
- Specify the rel attribute for Google. This will help the system more accurately index your content and show users the most relevant pages. Implementation details below.
Using rel = “next | prev”
If you prefer the latter option, let's get started! Suppose you have content and it is presented as follows:
www.example.com/article?story=abc&page=1www.example.com/article?story=abc&page=2www.example.com/article?story=abc&page=3www.example.com/article?story=abc&page=4')
On the first page,
www.example.com/article?story=abc&page=1 , you need to include in the following block:
<link rel="next" href="http://www.example.com/article?story=abc&page=2" />
On the second page,
www.example.com/article?story=abc&page=2 :
<link rel="prev" href="http://www.example.com/article?story=abc&page=1" /> <link rel="next" href="http://www.example.com/article?story=abc&page=3" />
On the third page,
www.example.com/article?story=abc&page=3 :
<link rel="prev" href="http://www.example.com/article?story=abc&page=2" /> <link rel="next" href="http://www.example.com/article?story=abc&page=4" />
And on the last page,
www.example.com/article?story=abc&page=4 :
<link rel="prev" href="http://www.example.com/article?story=abc&page=3" />
A few notes:
- The first page contains only rel = "next".
- The pages from the second to the last contain both rel = "next" and rel = "prev".
- The last page contains only rel = "prev".
- The href values can be either relative or absolute URL. And, if you declared a base in a document, the relative paths will be calculated according to the base URL.
- The use of the value rel = "previous" as an alternative to rel = ”prev” is allowed.
- In case of incorrect markup, Google will continue to index your content with your own heuristics without relying on the specified rel.
Good layout and interesting projects!