How to change title of...

public
TonW - Thu, 2008-01-31 14:20

Hi,

I have been checking Google Webmaster Tools and i got 32 Duplicate meta descriptions:

All the /node?page=* pages.

How do i add custom titles for those pagination pages?

Thanks.

Ah...

NikLP's picture
NikLP - Thu, 2008-01-31 21:00

I was going to leave an answer here, but I thought about it, and I would have been wrong.

So, subscribing... :)

Kineta Systems - Web Development in Nottingham, UK


This isn't the answer your looking for

Brian Harris - Fri, 2008-02-01 19:51

I personally add rel="nofollow" to my pagination menu in order to prevent duplicate content. I'm curious to see the true solution.

Nofollow doesn't prevent

J. Cohen's picture
J. Cohen - Sat, 2008-02-02 02:09

Nofollow doesn't prevent spiders from indexing those pages if there are other ways they can find the pages. If you do block the paginated pages there should be another way for search engine spiders to reach your older content. Otherwise, once a post goes to ?page=2 there won't be any internal links pointing to it.

I don't know about adding meta description to the paginated pages, but I block the home page's pagination with robots.txt:

User-agent: *
Disallow: /node

Otherwise you get the following duplicated page:

example.com/node (when you are on /node?page=1 the #1 links to /node)


Wont work for me.

TonW - Mon, 2008-02-04 08:57

I dont think that would work for me, i am using the classic clean urls, node/1 and all those, disallowing /node would disallow all my content, not only the pagination.

Or am i wrong?

Google and Yahoo

J. Cohen's picture
J. Cohen - Mon, 2008-02-04 09:39

The following should work in Google and Yahoo:

# blocks only /node
Disallow: /node$

# blocks any URLs that contain the parameter page=
Disallow: /*page=

I wouldn't use the last rule though (blocking pagination) because Google will probably have trouble finding older posts.


Still looking.

TonW - Mon, 2008-02-04 16:09

Still looking for a way to rename those pagination pages.

Aha!

NikLP's picture
NikLP - Mon, 2008-02-04 20:22

Ok I misunderstood what you're trying to do - if I understand correctly, you have many paginated pages from a single view/taxonomy list that all have similar meta descriptions?

The way to override this is use the nodewords (meta tags) module - in the settings, you can opt to suppress meta tags for all listed pages - it will only display the meta tags on the original (first) page.

Kineta Systems - Web Development in Nottingham, UK


Both

TonW - Tue, 2008-02-05 16:37

The idea is adding differente title and metatags for all the pagination pages /node?page=1.

pagination

J. Cohen's picture
J. Cohen - Tue, 2008-02-05 17:18

I don't know how to do it but there might be some ideas in the code from the page_title module...

These are two things Drupal needs:

  • different titles on paginated pages (even just <title>Page 2 - [title]</title> would be enough)
  • clean URLs for pagination

Exactly

juanzo@drupal.org - Wed, 2008-03-05 16:02

That's exactly what I need. On a default front page, I have hundreds of "?page=10, ?page=11, etc." duplicate meta descriptions and duplicate title tags. Both set of errors are reported at the Google Webmaster Tools and I can't find a way to avoid them.

Blocking the pagination pages from Google is not a good approach since, like J. Cohen says, what we need is:

  • Different titles like "Title - Page 2" for example
  • Different meta description or no description at all for the pagination pages

Does anyone have any clue on how to accomplish this?

Already asked a feature for

TonW - Thu, 2008-03-06 06:13

Already asked a feature for Page Title module in this feature request: http://drupal.org/node/224262 but i dont know how to answer what nicholasThompson asks.

True

TonW - Tue, 2008-02-05 18:57

I have to agree with you in that, both things would be real good, and there is a "bug" too in the pagination, first page is linking to /node not to the url and it looks duplicate for the search engines.

/node bug

J. Cohen's picture
J. Cohen - Wed, 2008-02-06 07:38

It's definitely a duplicate to the front page, but I'm wondering if it's a bug?

If you have a custom front page then /node is a link to the first set of posts in the paginated series.

I think it would be better to just make this standard practice:

  • always create a custom front page. If you have a custom front page then /node is not duplicate...
  • always use URL aliases and the Global Redirect module to redirect from /node/123 URLs to the URL aliases

Uh...?

NikLP's picture
NikLP - Wed, 2008-02-06 09:01

Surely if you have a custom home page, then /node is always a duplicate?!

Either way, you can get around that using robots.txt.

I'll have a word with the maintainer of page_title about the pagination option. How serious is this issue tho? This is the first time I've heard mention of it.

Kineta Systems - Web Development in Nottingham, UK


front page

J. Cohen's picture
J. Cohen - Wed, 2008-02-06 09:54

The default setting of Drupal is that the home page is a duplicate of /node. If you make a custom front page then /node is no longer duplicate content.


Interesting points!

nicholasThompson@drupal.org's picture
nicholasThompso... - Wed, 2008-02-06 11:39

That new Content Analysis is REALLY nifty!

If you install Global Redirect (as long as you're not using i18n as they dont like each other right now!) then the issue of dupe content between the frontpage path and the actual frontpage (eg, http://example.com/ and http://example.com/node) is solved as Global Redirect does a 301 redirect there. It also solves the issue of aliases and source paths providing the same content.

Interesting suggestion about Page Title's having an appended "Page 2/3/4/5" feature for listings/views... I'm currently working on integrating Page Title 2 (currently in alpha stages) with Views.
http://drupal.org/node/176985

Page Title suffixing should be pretty easy... All you'd need to do is check if there is a "page" argument and then suffix the data. Thinking about it though... What if you have a page with multiple pagers on it? What should happen to the title then? (this is a bit of an "edge case")


If you install Global

J. Cohen's picture
J. Cohen - Wed, 2008-02-06 14:44

If you install Global Redirect (as long as you're not using i18n as they dont like each other right now!) then the issue of dupe content between the frontpage path and the actual frontpage (eg, http://example.com/ and http://example.com/node) is solved as Global Redirect does a 301 redirect there.

Good point... I didn't notice that on my sites because I generally use a custom front page. Global Redirect redirects whatever you set your home page URL to be to the actual home page (e.g., node or front_page.

What if you have a page with multiple pagers on it? What should happen to the title then? (this is a bit of an "edge case")

What do you mean by multiple pagers?


Hm...

NikLP's picture
NikLP - Wed, 2008-02-06 17:46

Not sure how that would work, but as you say Nick, multiple pagers is pretty damn niche. I can't even think of a use case at the moment. I mean, this would never work with Panels (or something) and pagers, would it?

I was thinking maybe we could have a token for pagers, but I suppose it's not really necessary - ie then you could place the page number where you wanted in the page_title field. Not a great deal of point tho - unless you have very long titles and want users to be able to see them in the title. Unlikely though.

Web Development in Nottingham, UK by Kineta Systems


Page

TonW - Thu, 2008-02-07 11:12

Any idea why Global Redirect module is redirecting with 301 node?page=* to ?page=*? Is this usual or doesnt work with 5.7?

Er well...

NikLP's picture
NikLP - Thu, 2008-03-06 11:50

Perhaps you should direct that to the G_R issues queue, or check it out there to see if it's reported...?

However, IIRC, G_R simply redirects /node to /, so maybe this is expected?

Web Development in Nottingham, UK by Kineta Systems


I did the issue queue there

TonW - Thu, 2008-02-07 16:27

I did the issue queue there 1 minute after i post it here, i should have made it just there. Its offtopic but anyway i dont think that it should 301 redirect all the pagination to a new one.

quick and dirty solution for the problem

bara.munchies - Tue, 2008-09-23 16:18

i know it's quick and dirty, but maybe someone can write a cleaner solution for the templates.php file based on my idea. open for any improvements. would love to see your comment in the thread.

http://groups.drupal.org/node/8571