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?
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 portion of the code:
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.
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.
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.
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 %}
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.