How to edit the meta of collections page?

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 -%}

{%- endif -%}
{%- endif -%}

Hi Skyscraper,

Where would you add this piece of code? At the bottom of the section folder “collection-main liquid”

Hi Cristobal,
Where did add the code? In Section 'collection__main.liquid"?

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

Thanks for the reply, this is what I referring to

Any ideas?

Hi @getAuriga

Did you find Any solutions for this issue?

@shqipdonselmani Life saver! Worked perfectly thank you.

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 -%}
      
    {%- endif -%}

to

{%- if page_description -%}
{% if template == 'list-collections' %}

{% else %}

{%- 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.

1 Like

Agree with Michael140… Come on, Shopify. Please change this. It’s important to those of us who care.

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

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?

1 Like

Thanks this code worked perfectly for me. Though I had to put it in the file:
doc-head-core.liquid:

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’ %}

{% else %}

{%- 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’ %}

{% else %}

{%- 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’ %}

{% else %}

{%- 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 -%}

{%- 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’ %}

{% else %}

{%- endif -%}

{%- endif -%}

I hope that helps.