# Rel=next And Rel=prev

## Contents

The insertion of the HTML elements rel ="next" and rel ="prev" adds pagination on webpages. In this way you can indicate a relationship between parts of URLs through pagination or page numbering.

## Pagination options

There are several ways to number the pages on a website. You need to distinguish the type of website content. It can be an article that is spread over several pages, but also the topic of a forum which is being discussed across multiple pages. If the website operator uses pagination based on rel ="next" and rel ="prev", it is important that search engines are given a specific indication for this purpose. With it, the user is redirected to the most important page when selecting a search result. When using a view-all page option, this type of pagination may be dispensed with.

## How to insert rel="next" and rel="prev"

You can insert the elements rel="next" and rel="prev" with the following procedure, if the page is structured as below:

http://www.sample.com/article?story=abc&page=1
http://www. sample.com/article?story=abc&page=2
http://www. sample.com/article?story=abc&page=3
http://www. sample.com/article?story=abc&page=4
</ Pre>

In the <head> section of each page, the following must be specified:

On the first page:
<pre><link rel="next" href="http://www.sample.com/article?story=abc&page=2" />

On the second page:

<link rel="prev" href="http://www. sample.com/article?story=abc&page=1" />


On the third page:

<link rel="prev" href="http://www. sample.com/article?story=abc&page=2" />


And on the last page:

<link rel="prev" href="http://www.sample.com/article?story=abc&page =3" />


It should be noted that the first page should only contain rel="next" and the last page only rel="prev". The HTML elements rel="prev" and rel="next" are to be understood as indications for Google, not as absolute instructions. It can be both relative and absolute paths. If a <base> link is incorporated in the document, this means that relative paths dissolve according to the <base> URL. rel="next" and rel="prev" must be specified only in the <head> section and not in the document itself (<body>).

Google recognizes rel="previous" as a syntactic variant of rel="prev" links. An error that has been inserted, missing or incorrect designations means that the site has to be opened and you have to rely on Google’s heuristics.