Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi,
I was analyzing my store with a SEO tool and it appeared a problem.
Same metadescription on the home page and the collections page
Does anyone here know how to edit the one on a collections page as mine of a Brooklin theme. I guess it will probably require some CSS.
Thank you beforehand
Shopify has this covered!
1. Head over to Product > Collections.
2. Select the collection you want to edit the description of.
3. Scroll to the bottom. Click on Edit website SEO in the Search engine listing preview box.
4. Write a new description for that collection and save.
Hi Alex,
First of all, thank you for your answer. Unfortunately, following these steps only help to change the meta description of collections generated manually.
Shopify automatically generates a page '/collections' which isn't accessible anywhere on the dashboard. This auto-generated page takes the meta-description of the homepage, hence generating an SEO error for pages sharing the same meta description.
Could you please share a solution on how to change the meta description of this autogenerated page?
Many thanks,
Vladimir
I'm also looking for a solution to this.
Support?
Hi everyone! I'm also having the same issue, is there any way to update the root /collection meta ?
Same Issue here!
Thanks for your efforts
This can be achieved by editing the theme.liquid file. I recommend creating a backup first.
If your code looks different you'll need to adapt the code accordingly. You may need to change the template name as well if your theme is using something else. Leave off the .liquid part.
Change this:
To this:
Thank you so much Allen!!
I was able to implement this change and I think it's working.
Happy Holidays!
So glad I could help. Happy holidays!
If you wouldn’t mind, could you mark my answer as the solution to help others find it easier?
Cheers, Allen @ zippyslothseo.com
But this will change the meta data to all collections pages and only the "/all" page is missing the title and meta description... Its incredible that Shopify doesn't allow to easily edit that specific page when is one of the most important ones!!!
Thank you!
This didnt work for me right out the bat; but after changing the following it worked:
Original:
It doesn't work for me 😞
Sadly I have to agree with Javsan — neither the original recommendation or subsequent edit recommendations (e.g., by Cristobalgomez2 above) worked.
Agree x 3 (or however many times) that Shopify should allow us to easily change the meta description of the root /Collections page
Agree with Michael140... Come on, Shopify. Please change this. It's important to those of us who care.
This worked for the description thank you but not the title, any ideas why? thanks
Hi Cristobal,
Where did add the code? In Section 'collection__main.liquid"?
How do you update the meta title?
I wanna change it for my collections/all page as well, the indexed page in google shows the first text on the black banner and promo banner. I tried the solution above and replaced 'collection-list' with '/collections/all' , then tried with list-collections-template, then list-collections, collections/all....
None of the above worked, I dont know what the correct term is to put instead collection-list. When I inspect my page it still shows the main page meta description. And any idea why Google indexed it with the text on the page instead of at least the main page meta description?
https://skillwiz.store/collections/all
For me it works this code:
My path to collections is this: /collections : You need to enter your path
{%- if page_description -%}
{%- if request.path == '/collections' -%}
<meta name="description" content="DESCRIPTION HERE">
{%- else -%}
<meta name="description" content="{{ page_description | escape }}">
{%- endif -%}
{%- endif -%}
I had to type in 'list-collections' to properly target my collections list. (www.voltlin.com/collections)
{% if template == 'list-collections' %}
You can use it:
{% if page_description %}
<meta name="description" content="{{ page_description | escape }}">
{% else %}
<meta name="description" content="YOUR CONTENT">
{% endif %}
Hi everyone this is the way i made it work
Hello guys,
I came up with a way around and a good solution
Add this code to settings_schema.json file
{
"name": "Collections Meta",
"settings": [
{
"type": "text",
"label": "Meta Description",
"id": "metadescriptioncollections"
}
]
},
It will create a section to the THEME SETTINGS for you to change it
And then on the theme.liquid file change this
This worked brilliantly, thank you, a very neat solution.
Only problem is now the page is missing it's H1 heading.
Is it possible to add another line of code to be able to input H1 heading in the same way in the theme settings?
Hello there,
What do you mean by its missing its H1 heading.
Can you show you case in here and we can try and find a solution.
Have a great day
I reckon it's depends on theme's template name, but this one worked for me:
{% if template == 'list-collections' %}
{% assign page_title = "Page title here" %}
{% assign page_description = "Meta description here." %}
{% else %}
{%- if page_description -%}
<meta name="description" content="{{ page_description | escape }}">
{%- endif -%}
{%- endif -%}
Hi Skyscraper,
Where would you add this piece of code? At the bottom of the section folder "collection-main liquid"
Which piece of code?
Edit your 'theme.liquid" file by looking for
{%- if page_description -%}
that entire section of code should go from
{%- if page_description -%}
<meta name="description" content="{{ page_description | escape }}">
{%- endif -%}
to
{%- if page_description -%}
{% if template == 'list-collections' %}
<meta name="description" content="{{ settings.metadescriptioncollections }}">
{% else %}
<meta name="description" content="{{ page_description | escape }}">
{%- endif -%}
{%- endif -%}
The line where I have "settings.metadescriptioncollections" is because I set a field in the theme settings so it can be managed from there, rather than hard coding it into the theme.liquid file.
Thanks this code worked perfectly for me. Though I had to put it in the file:
doc-head-core.liquid:
I'm also sitting here wondering how to update a missing Meta Description in /collections/all
It's crazy to think Shopify expect people to hard code and try to guess multiple possible solutions.
I've tried all of the above and i can't get it to work. Has anyone had any success?
Check you file: doc-head-core.liquid and you can try updating the code there ( using the above code from Jondiego )
Hi there,
I actioned this exactly as you advised and the page is still missing it's description. See my code below. Can you tell me where in the theme settings are you managing this?
{%- if page_description -%}
{% if template == '/collections/all' %}
<meta name="description" content="Discover our high quality protein powders, and supplements in our range, with up to 20+ delicious flavours to choose from">
{% else %}
<meta name="description" content="{{ page_description | escape }}">
{%- endif -%}
{%- endif -%}
Hi! Try changing the second line of your code to the below which is in bold.
Kind regards,
Brooke
{%- if page_description -%}
{% if template == 'list-collections' %}
<meta name="description" content="whatever you want to put in here ">
{% else %}
<meta name="description" content="{{ page_description | escape }}">
{%- endif -%}
{%- endif -%}
Still doesn't work taking that approach.
In your templates folder you will have a file something like list-collections.json Do you have that ? Could be collection-list ? It can be different for different themes. What ever that file is called thats what you should put in this part: {% if template == 'list-collections' %}
Yes, that file is there. So you're saying the below code goers there?
{%- if page_description -%}
{% if template == 'list-collections' %}
<meta name="description" content="whatever you want to put in here ">
{% else %}
<meta name="description" content="{{ page_description | escape }}">
{%- endif -%}
{%- endif -%}
no, not in there.
Step 1. You need to check the name of that collection file in the template folder. What ever that name is, will be the name you put in the code.
if the file name is list-collections.json, then the line should be {% if template == 'list-collections' %}
if the file name is collection-list, then the line should be {% if template == 'collection-list' %}
Step 2. Once you have the correct code, you need to find the file that contains this particular code below. For me, I found it in
Doc-head-core.liquid but for you, it could be in a different file.
Find this code somewhere in your current files:
{%- if page_description -%}
<meta name="description" content="{{ page_description | escape }}">
{%- endif -%}
Step 3. Once you find the above code you need to replace it with the new code. You need to make sure you use the correct list-collections name ( which you found in Step 1 ) :
{%- if page_description -%}
{% if template == 'list-collections' %}
<meta name="description" content="{{ settings.metadescriptioncollections }}">
{% else %}
<meta name="description" content="{{ page_description | escape }}">
{%- endif -%}
{%- endif -%}
I hope that helps.
Okay, the file is called list-collections.json
I've carried out the steps exactly as you've outlined. So where do you had the meta description? Where is the settings for the /collections/all page?
I needed to add the code into Doc-head-core.liquid, but you might need to add the code somewhere else, like theme.liquid
This is the top of my theme.liquid - and this line ( {%- render 'doc-head-core' -%} ) is how I knew I needed to change doc-head-core.liquid:
{%- liquid
assign rtl_langs = 'ar,arc,dv,fa,ha,he,khw,ks,ku,ps,ur,yi' | split: ','
assign current_lang = localization.language.iso_code | split: '-' | first
if rtl_langs contains current_lang
assign lang_dir = 'rtl'
else
assign lang_dir = 'ltr'
endif
-%}
<!doctype html>
<html class="no-js" lang="{{ request.locale.iso_code }}" dir="{{ lang_dir }}">
<head>
{%- render 'doc-head-core' -%}
{%- render 'doc-head-social' -%}
What code do you have in your <head> of theme.liquid ?
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024