Solved

Can I include SKU code in Shopify title tag for SEO?

cotty
Excursionist
22 0 7

Hi, feeling defeated so giving this forum a try.

Can anyone point me in the right direction to pull in the SKU code for title tag, please? I've found how to do this on product pages etc, but can't find anywhere that references how to include within title tag for SEO purposes.

Accepted Solution (1)

KieranR
Shopify Partner
333 27 115

This is an accepted solution.

How exactly do you want it to be output? What if no sku exists? What if some variants have it but others don't?

General approach will be  to find the title tag liquid usially in theme.liquid and then use some of this in it:

{%- assign current_variant = product.selected_or_first_available_variant -%} <span>{{ current_variant.sku }}</span>

Full time Shopify SEO guy, based in NZ. Sometimes freelance outside the 9-5.

View solution in original post

Replies 2 (2)

KieranR
Shopify Partner
333 27 115

This is an accepted solution.

How exactly do you want it to be output? What if no sku exists? What if some variants have it but others don't?

General approach will be  to find the title tag liquid usially in theme.liquid and then use some of this in it:

{%- assign current_variant = product.selected_or_first_available_variant -%} <span>{{ current_variant.sku }}</span>

Full time Shopify SEO guy, based in NZ. Sometimes freelance outside the 9-5.
cotty
Excursionist
22 0 7

Thank you Kieran, worked a treat!