Problem when using paginate. 997 (55%) pages contain the same title. 979 (54%) pages contain the same description

I have Modx 3. And there is a problem when using paginate. 997 (55%) pages contain the same title.
979 (54%) pages contain the same description.
How to fix it?
The problem is that the results of different pages are displayed on the same page. Here is the call code on the page

[[!getPage? &element=`getResources` &parents=`710` &tpl=`insidetpl10` &elementClass=`modSnippet` &includeTVs=`1` &showHidden=`1` &limit=`10`]]

and in template

<head>
<title>[[*pagetitle]]</title>
<meta http-equiv="Content-Type" content="text/html; charset=[[++modx_charset]]" />
<meta http-equiv="Cache-Control" content="max-age=604800">
<meta name="Keywords" content="[[*tags]]"/> 
<meta name="description" content="[[*description]]"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>

I donā€™t understand your question.
Can you describe in more detail what exactly gets output incorrectly?
Does getPage output the title and description of a different page for some of the pages? If yes, from what page?
The template you provided, is this the chunk ā€œinsidetpl10ā€ or the template of the page where you call getPage?

I have a page that show to visitors anouncements of articles.And this page, which displays the announcements of articles, has the following template in a head

<head>
<title>[[*pagetitle]]</title>
<meta http-equiv="Content-Type" content="text/html; charset=[[++modx_charset]]" />
<meta http-equiv="Cache-Control" content="max-age=604800">
<meta name="Keywords" content="[[*tags]]"/> 
<meta name="description" content="[[*description]]"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>

next, I make a call to these announcements via getpage

[[!getPage? &element=`getResources` &parents=`710` &tpl=`insidetpl10` &elementClass=`modSnippet` &includeTVs=`1` &showHidden=`1` &limit=`10`]]

the insidetpl 10 template has the following code:

<div>
  <h2>[[+pagetitle]]</h2>
</div> 
<table style="width: 100%"  class="anons">
	
	<tr>
	
<a href="[[~[[+id]]]]"><img width="100%" height="100%" alt="[[+longtitle]]" src="[[+tv.image2]]"></a>
		<p align="justify">[[+description]]</p> <p><strong><a class="content" href="[[~[[+id]]]]">ŠŸŠ¾Š“рŠ¾Š±Š½ŠµŠµ...</a></strong></p>


	</table>

This displays article announcements with images and descriptions, and getpage itself displays 10 article announcements per page.
So, when there are so many articles that getpage begins to split the output into several pages, the problem arises that already on the second page, the title and description on the page 2 are the same
like on page 1.
For example:
sightinghs.html has code:

<head>
<title>Hello world</title>
<meta http-equiv="Content-Type" content="text/html; charset=[[++modx_charset]]" />
<meta http-equiv="Cache-Control" content="max-age=604800">
<meta name="Keywords" content="tag1, tag 2, tag3"/> 
<meta name="description" content="The description"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>

sightinghs.html?page=2 has the same code in title:

<head>
<title>Hello world</title>
<meta http-equiv="Content-Type" content="text/html; charset=[[++modx_charset]]" />
<meta http-equiv="Cache-Control" content="max-age=604800">
<meta name="Keywords" content="tag1, tag 2, tag3"/> 
<meta name="description" content="The description"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>

Search engines start swearing and saying that you have the same headlines on these pages. How to unify these headings when paginated? with this output, it is not added to the title on the second page, for example, that this is the second page, the third page, and so on, because in fact we are on the same page all the time, as I understand it. And the search engine sees it as different pages, and swears at the same title of 1 page of the announcement of articles and 2.

So I see, itā€™s an SEO problem.

There are different ways to deal with this:

  • You could instead use pdoPage (from pdoTools). pdoPage by default outputs header tags like this:
<link rel="canonical" href="http://mysite.com/mypage.html"/>
<link rel="prev" href="http://mysite.com/mypage.html?page=2"/>
<link rel="next" href="http://mysite.com/mypage.html?page=4"/>
  • pdoTools also has a snippet pdoTitle, that integrates the site number into the title.

  • Or you could read the value of the GET parameter ā€œpageā€ and integrate its value into the <title> tag yourself, to make it unique.

  • Or you could add a noindex meta tag for all the pages but the first one.

<meta name="robots" content="noindex, follow"/>

Not sure what the best approach is though, as Iā€™m no SEO expert.

1 Like

Yes, it works! thank you!

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting ā€œ+ New Topicā€.