Solved

Where is link rel property generated?

demib
Shopify Partner
132 13 62

I can't seem to find the object/file that output the link property (for example for next/prev).

It is not a specified element in the themes-liquid file. I somehow suspect it's in the required {{ content_for_header }} but as I can see and edit that I am not sure.

Do any of you know this and where I can edit the link property in the header?

SEO Geek since 1996, consultant author and public speaker. Admin of the Shopify SEO Facebook Group

Was your question answered? Kindly mark it as an Accepted Solution 🙂
Accepted Solution (1)
demib
Shopify Partner
132 13 62

This is an accepted solution.

I finally found a solution. It may not be too elegant but it works.

DISCLAIMER: As editing the content_for_header object is not recommended this may give you problems if Shopify make changes to this object. However, I think it should be OK for now. But be careful.

So, this is my solution ...

{%- comment -%}
  		{{ content_for_header }}
	{%- endcomment -%}
    
    {% capture custom_content_for_header %}
    	{{ content_for_header | replace: '?page=1', ''}}
	{% endcapture %}

    {{ custom_content_for_header }}
    

 

 

SEO Geek since 1996, consultant author and public speaker. Admin of the Shopify SEO Facebook Group

Was your question answered? Kindly mark it as an Accepted Solution 🙂

View solution in original post

Replies 8 (8)

Ninthony
Shopify Partner
2330 350 1024

What link are you trying to find exactly? The only thing I can think of what you're talking about would be the canonical url, which is generally found in theme.liquid in the <head> portion of the code:

<link rel="canonical" href="{{ canonical_url }}" />
If my solution helped you, please like it and accept it as the solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish 😄
demib
Shopify Partner
132 13 62

Thanks, but the CANONICAL property is specified in the theme.liquid file. I already did some mods to that 🙂🙂

What I am looking for is the prev/next property. I changed the pagination scheme to get rid of the "page=1" links, but that is still used on >1 pages in the link rel property. So want to get rid of it there too - or maybe remove all prev/next entirely, as Google is not actually using it anymore. 

SEO Geek since 1996, consultant author and public speaker. Admin of the Shopify SEO Facebook Group

Was your question answered? Kindly mark it as an Accepted Solution 🙂
Ninthony
Shopify Partner
2330 350 1024

Hm I don't think I'll be able to help you since I don't really know what you're talking about lol. SEO isnt exactly my thing, if you do get it figured out though would you please post an update here so that maybe I can understand a bit better? I would appreciate it.

If my solution helped you, please like it and accept it as the solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish 😄
demib
Shopify Partner
132 13 62

That is perfectly OK. We all have different skills - and I admit, after +20 years dealing with SEO that's sort of my game 🙂

But let me shortly explain ...

In general Google do not want to index the same - or almost the same content on multiple unique pages (the unique text elements on a page). No matter if the content is found on the same, or on different sites. From a pure data management point of view it makes no sense and from a search user point of view Google want diversity. 

Dealing with this is what we, in SEO usually refer to as Duplicate Content (DC). 

When Google find Duplicate Content they usually filter out some of the versions from search results. If they find it on your site, and filter it out, that filtering can also harm other - not DC pages. It's a long story, but the fact is that if WE can manage DC perfectly so Google do not filter it out on our sites, then we end up with stronger SEO.

There are an almost endless ways to end up with DC-issues. One of them is URL's that can be accessed with or without parameters - such as it is the case (as default) on most Shopify sites because the pagination links and the link prev/rel property use ?=page=1 linking back to the first page. 

The visual part of the problem - the pagination links I have already fixed. But the link prev/next property is still left for Google to find. I want to either fix it or remove it. As Google do not actually use this data anymore it can be removed. However, as it is still a webstandard other agents may use I'd prefer to keep it - but fix it Get rid of the ?page=1 parameter).

But to do that I need to find the code that creates the link prev/next property.

SEO Geek since 1996, consultant author and public speaker. Admin of the Shopify SEO Facebook Group

Was your question answered? Kindly mark it as an Accepted Solution 🙂
Ninthony
Shopify Partner
2330 350 1024

Ok so you're looking for the pagination. You can likely find it in a collection-template.liquid file in the sections folder and look for something like:

 

{% if paginate.pages > 1 %}
  //some code to either ouput the default pagination, may look like this:
  //{{ paginate | default_pagination }}
  // or they could be implementing their own pagination using the paginate object
{% endif %}

 

https://shopify.dev/api/liquid/objects/paginate

 

If my solution helped you, please like it and accept it as the solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish 😄
demib
Shopify Partner
132 13 62

Thanks, but no - it's not the visual pagination I am looking for. I already fixed that. It's the link prev/next property in the header.

 

<link rel="prev" href="/collections/vases?page=1">
<link rel="next" href="/collections/vases?page=3">

 

It is primarily the ?page=1 I want to get rid of. It creates a DC problem.  

SEO Geek since 1996, consultant author and public speaker. Admin of the Shopify SEO Facebook Group

Was your question answered? Kindly mark it as an Accepted Solution 🙂
demib
Shopify Partner
132 13 62

This is an accepted solution.

I finally found a solution. It may not be too elegant but it works.

DISCLAIMER: As editing the content_for_header object is not recommended this may give you problems if Shopify make changes to this object. However, I think it should be OK for now. But be careful.

So, this is my solution ...

{%- comment -%}
  		{{ content_for_header }}
	{%- endcomment -%}
    
    {% capture custom_content_for_header %}
    	{{ content_for_header | replace: '?page=1', ''}}
	{% endcapture %}

    {{ custom_content_for_header }}
    

 

 

SEO Geek since 1996, consultant author and public speaker. Admin of the Shopify SEO Facebook Group

Was your question answered? Kindly mark it as an Accepted Solution 🙂
John_shamamyan
Visitor
1 0 0

Where does this code go?