<![CDATA[ SEO-friendly Pagination with getPage - My Forums]]> https://forums.modx.com/thread/?thread=37914 <![CDATA[Re: SEO-friendly Pagination with getPage]]> https://forums.modx.com/thread/37914/seo-friendly-pagination-with-getpage?page=3#dis-post-560542
It's been over four years since the last update and things have changed, what with infinite scrolling and mobile optimised pages to name just a few..

Be good to get an uptodate tute on this.

Then again, a modx extra that just did seo friendly pagination properly would be a great extra.

Or is that really just an update to getpage?

Beyond me, I'm not a tech guy, but happy to have the conversation.

]]>
markg Aug 09, 2018, 04:04 AM https://forums.modx.com/thread/37914/seo-friendly-pagination-with-getpage?page=3#dis-post-560542
<![CDATA[Re: SEO-friendly Pagination with getPage]]> https://forums.modx.com/thread/37914/seo-friendly-pagination-with-getpage?page=2#dis-post-518890
<link rel="next" href="domainname.com/risultati-di-ricerca.html?search=prova&searchsb=Cerca&page=3" /> 

<link rel="prev" href="domainname.com/risultati-di-ricerca.html?search=prova&searchsb=Cerca&page=1" /> 


I head part of page?]]>
cristianb88 Jan 21, 2015, 09:33 AM https://forums.modx.com/thread/37914/seo-friendly-pagination-with-getpage?page=2#dis-post-518890
<![CDATA[Re: SEO-friendly Pagination with getPage]]> https://forums.modx.com/thread/37914/seo-friendly-pagination-with-getpage?page=2#dis-post-511101
I place a snippet like this on every template that uses getpage :

<?php

if (isset($_GET["page"]))
{
   echo'<meta name="robots" content="noindex,follow" />';
}

else {
	echo'<meta name="robots" content="index,follow" />';
}
?>


Make sure it is uncached.]]>
kilroy Sep 24, 2014, 01:33 AM https://forums.modx.com/thread/37914/seo-friendly-pagination-with-getpage?page=2#dis-post-511101
<![CDATA[Re: SEO-friendly Pagination with getPage]]> https://forums.modx.com/thread/37914/seo-friendly-pagination-with-getpage?page=2#dis-post-498749 esnyder May 27, 2014, 01:00 PM https://forums.modx.com/thread/37914/seo-friendly-pagination-with-getpage?page=2#dis-post-498749 <![CDATA[Re: SEO-friendly Pagination with getPage]]> https://forums.modx.com/thread/37914/seo-friendly-pagination-with-getpage?page=2#dis-post-498365 Quote from: esnyder at May 20, 2014, 04:34 PM
Hi effect-energy, I'm not sure why that is, but now that I think about it, the best way to do what kilroy was talking about is probably to just use an output filter on the page placeholder. Put this in the :
[[!+page:is=`1`:then=`<meta name="robots" content="index,follow">`:else=`<meta name="robots" content="noindex,follow">`]]


That's a lot simpler than trying to figure it out inside a snippet and then return the appropriate tag.

Thank you for this solution, but for me, it only works if I put it after the getPage call.

If I put the code you provide in the <head>, it only returns noindex, follow, even if it is on the first page.

Here is the getPage call I use in my page body:
[[!getPage@langfr?
   &elementClass=`modSnippet` &element=`getResources` &parents=`[[*id]]` &depth=`1` &limit=`2` &pageVarKey=`page` &includeTVs=`1` &processTVs=`1` &showHidden=`1` &tpl=`actualite-lien` ]]


If I put [[+page]] in the head, it returns the relevant value.]]>
kilroy May 21, 2014, 02:38 PM https://forums.modx.com/thread/37914/seo-friendly-pagination-with-getpage?page=2#dis-post-498365
<![CDATA[Re: SEO-friendly Pagination with getPage]]> https://forums.modx.com/thread/37914/seo-friendly-pagination-with-getpage?page=2#dis-post-498292
[[!+page:is=`1`:then=`<meta name="robots" content="index,follow" />`:else=`<meta name="robots" content="noindex,follow" />`]]


That's a lot simpler than trying to figure it out inside a snippet and then return the appropriate tag.]]>
esnyder May 20, 2014, 11:34 AM https://forums.modx.com/thread/37914/seo-friendly-pagination-with-getpage?page=2#dis-post-498292
<![CDATA[Re: SEO-friendly Pagination with getPage]]> https://forums.modx.com/thread/37914/seo-friendly-pagination-with-getpage?page=2#dis-post-498278
this:
 <head>
  <meta name="test2" content="[[+page]]" />
  [[+paginated-metas]]


returns:
<meta content="3" name="test2">
<meta content="index,follow" name="robots">


[[+page]]=3
[[+paginated-metas]]=1
..?]]>
effect-energy May 20, 2014, 09:19 AM https://forums.modx.com/thread/37914/seo-friendly-pagination-with-getpage?page=2#dis-post-498278
<![CDATA[Re: SEO-friendly Pagination with getPage]]> https://forums.modx.com/thread/37914/seo-friendly-pagination-with-getpage?page=2#dis-post-498229 Quote from: kilroy at May 13, 2014, 08:59 AM
what method would you recommend to have <meta name="robots" content="noindex,follow"> ONLY on paginated pages?
I think it would be easy enough to do this with a modified version of the snippet I described in the original post. Instead of selecting unique titles and descriptions for paginated pages, the snippet would just set your meta tags the way you want them, like this:

$properties =& $scriptProperties;
$properties['page'] = (isset($_REQUEST[$properties['pageVarKey']]) && ($page = intval($_REQUEST[$properties['pageVarKey']]))) ? $page : 1;
 
if ($properties['page'] == 1) {
    $modx->setPlaceholder('paginated-metas', '<meta name="robots" content="index,follow" />');
}else{
    $modx->setPlaceholder('paginated-metas', '<meta name="robots" content="noindex,follow" />');
}



Then just put the placeholder [[+paginated-metas]] in your <head>]]>
esnyder May 19, 2014, 12:57 PM https://forums.modx.com/thread/37914/seo-friendly-pagination-with-getpage?page=2#dis-post-498229
<![CDATA[Re: SEO-friendly Pagination with getPage]]> https://forums.modx.com/thread/37914/seo-friendly-pagination-with-getpage?page=2#dis-post-497824
After reading this pagination guide, there are several methods to handle it:

  • noindex, follow on every paginated page except the first
  • see all page with a canonical pointing towards it
  • rel="previous" and rel="next" in the page head

I have read that rel="noindex" did not work on anchor links.

So it seems to me that the first method is the one that suits my case the best.

But what method would you recommend to have <meta name="robots" content="noindex,follow" /> ONLY on paginated pages?]]>
kilroy May 13, 2014, 03:59 AM https://forums.modx.com/thread/37914/seo-friendly-pagination-with-getpage?page=2#dis-post-497824
<![CDATA[Re: SEO-friendly Pagination with getPage]]> https://forums.modx.com/thread/37914/seo-friendly-pagination-with-getpage?page=2#dis-post-462901
My advice on that, for what it's worth, would be don't do it that way. The whole point of using the rel="next" and rel="prev" attributes is that you are telling search engines that you want them to index the next and previous pages as separate pages. But by having the canonical link element pointing to the first page, you are telling search engines that you want them to treat all of the subsequent pages as duplicates of the first page and ignore them. So that's a contradiction, and I'm not sure how search engines will interpret it.

If you're going to use rel="next" and rel="prev" you should have the canonical tag point to the actual full URL of whatever page is being displayed, as you were originally doing if I understand you correctly.

Also, there's no need to use a TV for the canonical unless you really want to for some reason - generally it's better to use this:

<link rel="canonical" href="[[++site_url]][[*id:isnot=`[[++site_start]]`:then=`[[~[[*id]]]]`]]" />


See this thread: http://forums.modx.com/thread/?thread=44222&i=1&page=1]]>
esnyder Apr 14, 2013, 02:10 PM https://forums.modx.com/thread/37914/seo-friendly-pagination-with-getpage?page=2#dis-post-462901