While this is a question, it is as well a serious warning to publishers that separate their posts using <!--nextpage-->
.
Bare with me. I run a highly trafficked multiple author platform that rank very high on search engines. While making SEO related improvements, I noticed that only the first page of an article that is separated into several pages is being indexed by Google. How did I notice this?
Because someone grabbed the content of the unindexed pages of an article and posted it in their own site. This resulted in them ranking higher than me on that particular keyword. Actually, let me rephrase that, my site’s article is not even indexed beyond the first page.
My question is, how can I make the search engines index the whole article if it is separated into several pages? Ideally, a script that displays the full article if the visitor is a search engine (if that would not be harmful for SEO). Other suggestions are welcome.
On a side-note, if I was into Black Hat techniques, there would be a goldmine of content out there that I could exploit. Think about it.
And on a personal note, this issue should be addressed in a future update of WordPress.
Update: A similar question that detailed how WordPress creates the same canonical URL for all pages in a paginated sequence was asked here, however the answer that was posted and marked as correct does not answer the question. That solution works for paged comments only, not paginated posts.
Update 2: According to this blog post by Google, we can use rel=ânextâ
and rel=âprevâ
to indicate the relation between pages. So for instance, this is what we should include in <head>
on page 2:
<link rel="canonical" href="http://domain.com/article/2" />
<link rel="prev" href="http://domain.com/article/1" />
<link rel="next" href="http://domain.com/article/3" />
And there should not be a rel=”prev” or “next” if there isn’t a page after/before it.
The basic problem for a script solution is:
rel_canonical
does not offer any useful filter. So we have to replace that function:The next problem:
$GLOBALS['numpages']
is empty beforesetup_postdata()
. We could call that function already here, but it might have side-effects.Here is a solution that adds correct prev/next links too, and it prevents conflicting relations caused by
adjacent_posts_rel_link_wp_head
. We have too hook intowp_head
not later than priority 9 to deactivate the latter hook.Just FYI: Yoast’s WordPress SEO plugin takes care of adding rel=prev and rel=next meta data to the
<head>
of pages. That guy (Yoast) thinks of everything!