Liquid, JavaScript, themes, sales channels
Dear all,
i was reading an article from Semrush regarding Canonical and thought that i should implement the suggested changes.
The Blog Articles (german Blog) can be found here.
Since both Links are german language i will recap the suggested changes.
<title>
{{ page_title }}{% if current_tags %} – tagged "{{ current_tags | join: ', ' }}"{% endif %}
{% if current_page != 1 %} – Page {{ current_page }}{% endif %}{% unless page_title contains shop.name %} – {{ shop.name }}{% endunless %}
</title>
{% if page_description %} <meta name="description" content="{{ page_description | escape }}" /> {% endif %}
<link rel="canonical" href="{{ canonical_url }}" />
For your knowledge i am using Venture theme. I implemented the changes. But afterwards i found for the first step in Venture theme.liquid the code below. I have difficulties to interpret this, but is venture theme already ready for canonical and the suggested code from semrush is redundant?
Original already implemented in the original header
<link rel="canonical" href="{{ canonical_url }}">
<title>
{{ page_title }}
{% if current_tags %}
{% assign meta_tags = current_tags | join: ', ' %} – {{ 'general.meta.tags' | t: tags: meta_tags }}
{% endif %}
{% if current_page != 1 %} – {{ 'general.meta.page' | t: page: current_page }}{% endif %}{% unless page_title contains shop.name %} – {{ shop.name }}{% endunless %}
</title>
{% if page_description %}
<meta name="description" content="{{ page_description | escape }}">
{% endif %}
is venture theme already ready for canonical and the suggested code from semrush is redundant?
Yes, venture theme comes with default canonical line in the <head>. Every Shopify theme I've seen does too. The SEMrush blog you read about canonical tags sounds generic and not specific to your website or situation.
- Find {{ product.url | within: collection }}
- Replace with {{ product.url }}
- I understood that the effect is that if you click on product, you will be redirected to the .../products/productname url instead of having the collection added to the URL.
- Can anyone tell me if this is helpful for SEO?
- Side effect is that my breadcrumps got useless... i am not sure if i am happy with this. Does anyone have an opinion on this?
Opinions vary here - there are a few things to consider.
An alternative approach I quite like is to set a "primary" category per product via metafields, then build this into collections pages so each product page only has one URL under a primary category, and breadcrumbs still work, bit complex to get it right but can work well.
As a short answer though, yeah I generally prefer replacing the default with {{ product.url }} and flattening out the site structure and more clearly pointing link equity towards the primary product page.
Hi @KieranR ,
thanks for your oppinion, so i am happy that i did the right thing.
What do you exactly mean by
An alternative approach I quite like is to set a "primary" category per product via metafields, then build this into collections pages so each product page only has one URL under a primary category, and breadcrumbs still work, bit complex to get it right but can work well.
Do you mean setting up tags for the products?
Nah not tags, I mean per product metafields using a metafield app. This is one way that you could setup a relationship from product -> primary collection (aka category) and using this primary collection data from the products metafield to generate product URL's across the site.
End result being that a product would only have internal links pointing to:
/collections/primary-collection-name/products/product-name
^ even from other collections.
Then breadcrumbs would continue to work on PDPs. Personally I prefer this, though it is a bit more complex to setup & manage. It gets around the lack of primary category that is inherent to Shopify. I find this to be a slightly more SEO friendly approach than just flattening the entire site to root /products/product-name URLs as breadcrumbs. The reason being that it can be a useful tactic (among others) to shape the flow of internal link/topic equity flow to support category pages to rank for category terms.
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024