Mobile app version of vmapp.org
Login or Join
Cugini213

: Does rel="next" have to be in the HEAD? I'm trying to improve SEO on a platform i'm working with, and was advised to add rel="next" and rel="prev" links to my pages to make it clearer to

@Cugini213

Posted in: #Google #Indexing #MetaTags #Pagination

I'm trying to improve SEO on a platform i'm working with, and was advised to add rel="next" and rel="prev" links to my pages to make it clearer to google which URLS are paginated.

My question to you is, does google look anywhere except the head element for them?

Can i add them to the next page buttons themselves? Will that still work?

EG:

<a href='page.php?p=2' rel="next">
<a href='page.php?p=3' rel="next">


Or Maybe can i add them as a link element, but any random place in the page outside the head?
EG:

<link rel="prev" href="page.php?p=2">
<link rel="next" href="page.php?p=3">


Or does that type of link explicitly require it being present in the head and only in the head?

Accoring to Google WebMaster Central it's not required to be outside of the head, but that seems kind of ambiguous to me.


rel=”next” and rel=”prev” only need to be declared within the section, not within the document .


Does anyone happen to know what the specifics of that tag are and whether it'll index it properly if i put the link tags outside the head element?

(for anyone wondering why on earth i don't just put the rel tag in the head, it's because it needs to be dynamic and i couldn't find a way to dynamically insert php into the head element with our platform)

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Cugini213

2 Comments

Sorted by latest first Latest Oldest Best

 

@Connie744

Despite what anyone says or reads, rel is an attribute of <link> and that element is required by the HTML specification to always be in the <head> no matter what Google or anyone else says.


If the rel attribute is used, the element is restricted to the head
element.


Anywhere else makes your HTML invalid.

10% popularity Vote Up Vote Down


 

@Jennifer507

The specifics of Rel next and Rel Prev can be found on the google blog here: webmasters.googleblog.com/2011/09/pagination-with-relnext-and-relprev.html

The Rel next and rel prev go in the header.

Edit: Php is fully supported on any aspect of an dynamic page. Simply doing something like

<?php echo 'https://yourdomain.com/'.$yourdynamicinfo; ?>


would work perfectly fine in your html head.

It also states that the code must use the

<link rel="next" must be used in the header.


It is not like a

rel="no follow".


As for indexing properly, if google says it is looking for a specific tag, it is best to follow the guidelines they have in place for a tag. As it won't hurt you SEO wise, it will also not benefit you either. Also please be aware that post was from 2011 so it is quite old.

Ultimately this is to help bots understand the layout of your website and should not affect your rankings overall.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme