Tackling Potential Content Duplication Issues in Your WebStore

Oops @franclin_foping, now removed the opening and closing tags so you can see what I mean:

link rel=“prev” href=“http://broughtons.demostore.nitrosell.com/store/department/2/Door-Furniture/page5.html/page4.html”/
link rel=“next” href=“http://broughtons.demostore.nitrosell.com/store/department/2/Door-Furniture/page5.html”/
link rel=“canonical” href=“http://broughtons.demostore.nitrosell.com/store/department/2/Door-Furniture/page5.html”/

Hi @emma

Thanks for reporting that issue to us.

We will look into it and get back to you in due course.
Regards,
Franclin

I have been searching for quite a while on how to properly canonical tag category pages.

I have 2 main questions:

  1. How do I retrieve the base url for a category so I can just do an if(){ canonical link}

  2. Is there a way to canonicalize my category pages to a single category page that shows ALL the products for that category?

Thanks in advance,

  • Zach

Hi @zach ,

The canonical url is provided on every page if you follow the steps described in this post.

To provide an accurate as possible answer to your questions, please do you mind providing some examples and most importantly describing in details what exactly you are trying to achieve please?

Kindest regards,
Franclin

Thanks for the quick reply @franclin_foping,

My understanding from the above is a canonical tag is provided on the product pages, not the category pages, no? The {product[‘product_canonical_link’]} does seem to return a value on product pages, however, not category pages.

Currently our category pages (product lists) are paginated eg: “http://…/accessories/widgets/?page=1”, “?page=2”, etc.

Obviously it would be best practice to canonical tag these pages back to the originating category page.

However, I would Ideally like to do the following:

  1. have a category page that lists ALL of the products in a said category (view all)
  2. canonical tag all “?page=1,2,3,4,etc” paginated category pages to the view all page.

Initially I was trying to just tag it back to the primary category page as that would be acceptable, but even trying to do that I cannot seem to retrieve the category url variable I need for this.

Hopefully the above explains the issue more clearly, if not please let me know.

Thanks again!!!

  • Zach

@franclin_foping Has there been any update on a fix for this issue? I can confirm our site also has the same bug so it’s obviously affecting all stores.

Also, there is another issue which we have raised as a ticket recently describing that the canonical tag appears to be self referencing and therefore allows for stray URL parameters like sort=price&order, gclid, utm_source etc to end up being referenced in the canonical tag, obviously undesirable.

This only occurs with links that are shared (with those additional URL parameters) via external sites. None the less they do end up being indexed and are therefore another cause of duplicate content which should be addressed.

cheers.
Andy.

any updates today on this?

thanks!

Hi @zach

As I said earlier, the canonical tag is supplied in all our pages if you followed the steps explained in this post.

the product[‘product_canonical_link’] is indeed the canonical url to be used on product pages for matrix items.

It would be very helpful if you could provide an example of a category page which doesn’t contain a canonical url at all.

Regards,
Franclin

Hi @andy

We are currently working on a fix for both issues and will get back with an update in due course.

Thanks for your patience
Franclin

Hi @franclin_foping,

I am confused. Andy and I are talking about the same thing. You replied to me saying to use the product canonical variable for the category pages and NOT product pages. But then told Andy that you were going to fix the issues?

Can you please explain?

Thanks,

Zach

Hi @zach

Apologies for any confusion that may have arisen from my previous message.

The two issues that are being fixed are as follows:

1 - pagination links on certain pages
2 - provide a canonical url for pages that contain extra parameters in the query string such as gclid and others

Hope this helps.
Franclin

Ok, I have tried using {product[product_canonical_link]} for the category pages, and nothing comes back.

How do I get a canonical URL for the category pages to stop the duplicate content penalties I am getting for having page 1,2,3,4,5,6,etc for each category in our store.

thanks.

Hi @zach

I’m afraid the {product[product_canonical_link]} will only work on product pages.

The canonical URL on listing pages is the current page. So for instance, if you are visiting the page number 5 in the category page then it will be set to something like page5.html

To prevent duplication penalties, the page should instead tell to search engines the linkage between those pages as explained in the post. For instance in the header of page5.html there should be a prev link tag which points to the previous page (page4.html) and an eventual next rel tag which points to the next tag (page6.html).

If you could provide an actual page, then I can give you more explanation if you wish.

Hope this makes sense.

Regards,
Franclin

@franclin_foping:

I feel like I have been clear in communicating what I was looking for since the very first post and am going around in circles. If this is not the case, then my apologies and I will try and be clearer one more time.

Per my original post:

I then went on to say:

I understand that the canonical tag provided is for the product page and not the category page. And that I am looking for a page to canonical the categories to such as a view all page. Even still, the very first question I asked was for the category base url eg: “page 1” or “www…com/category/” url and if there is a way to generate a view all page.

You then say

Then finally I am told that the canonical link for the category is the same as the page in the category eg: page5 will be canonical tagged with page5…

A similar issue was posted in the spring by someone else here: Webmaster Tools Errors - #2 by david_acheson

But no solution was given, you went into their template and fixed it and referenced $this post.

  1. How do i retrieve either the base category url for the said category(page1,2,3,4,5,6) to use as the canonical page. eg: /widgets?page=5 would provide a canonical url of …widgets/ or …/widgets?page=1
  2. Is there a way to generate a view all page for categories so that I may canonicalize all of my page 1,2,3,4,5,6… to that page eg: widets?page=5 canonicalizes to widgets/ or best practices would be widgets/all

I would like to use canonical tags with a view all page rather than next and prev as it is considered a more definitive solution with less likelihood of issues and will provide a potential increase in usability.

However If the above cannot be accomodated, my next question would be:

  1. how do I retrieve the prev and next url’s using nitroscript?
  2. What variables do I check against to determine if there IS a next or prev? Are they bool, strings, eg will they return null/true/int to an if(category[next_page]){echo ‘…link…’;}

Could you please provide a code example?

Thanks!

Hi @franclin_foping, any updates on this?

also on another note:

I might be doing something wrong, not sure. But when I tried using the examples above in my header template I get the following errors:

{if (pageproperty['pageid'] eq 'filtered')}
 {ifThereAre pfscanonical}
  {forEach pfscanonical}
   <link rel="canonical" href="{pfscanonical['url']}"/>
   <meta property="og:url" content="{pfscanonical['url']}"/>
  {endForEach}
 {endIfThereAre}
{endIf}

Syntax Error

FATAL ERROR in header on line 15 : unknown list name: pfscanonicals

{forEach linkdata}
  <link rel="{ linkdata['rel'] }" href="{ linkdata['href'] }"/>
{endForEach}

I get the following

FATAL ERROR in header on line 13 : unknown list name: linkdatas

in the code it is not linkdata"s", or pfscanonical"s" I triple checked.

Thanks so much for your help!!

Hi @zach

That error would mean that the store on which you are trying to apply the nitroscript is not on Beta. As I mentioned in the post, the feature is only currently available in our Beta channel.

Regarding the other issue, the idea of avoiding duplication using prev and next rel tags was borrowed from this post Official Google Webmaster Central Blog: Pagination with rel=“next” and rel=“prev”

Hope this makes sense and apologies for the earlier misunderstanding.
Franclin

Thanks @franclin_foping,

however to the other issue regarding prev and next:

  1. How do i retrieve either the base category url for the said category(page1,2,3,4,5,6) to use as the canonical page. eg: /widgets?page=5 would provide a canonical url of …widgets/ or …/widgets?page=1

  2. Is there a way to generate a view all page for categories so that I may canonicalize all of my page 1,2,3,4,5,6… to that page eg: widets?page=5 canonicalizes to widgets/ or best practices would be widgets/all

  3. how do I retrieve the prev and next url’s using nitroscript?

  4. What variables do I check against to determine if there IS a next or prev?

Could you please provide a code example?

PS: Just a suggestion, but maybe mention the ‘beta’ part in the initial solution, and not after the solution examples have been given?

Currently it is in the section titled: 4. Bibliographic Notes

Thanks again!

Or am I right to understand that NONE of this functionality is available to me if I am not in Beta?

Yes I’m afraid that’s the case.

Is it recommended to run production shops on Beta?