Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Re: How to edit the meta of collections page?

How to edit the meta of collections page?

ajuanoba8
Visitor
1 0 1

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

Replies 42 (42)

Alex_Lam
Shopify Partner
95 30 28

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.

 

Is your store fast enough? Compare your store's speed against hundreds of others for free with our benchmarker - https://www.rvere.com/
VladBA
Visitor
1 0 10

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

Mitchellsmith
Tourist
5 0 9

I'm also looking for a solution to this.

 

Support?

_Peter_
Visitor
1 0 5

Hi everyone! I'm also having the same issue, is there any way to update the root /collection meta ?

WillMaxwell1
Visitor
1 0 1

Same Issue here!

Thanks for your efforts

zippyslothseo
Tourist
4 0 10

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:

  {% if page_description %}
     <meta name="description" content="{{ page_description | escape }}">
  {% endif %}

 

To this:

  {% if page_description %}
      {% if template == 'collection-list' %}
          <meta name="description" content="YOUR META DESCRIPTION HERE.">
      {% else %}
          <meta name="description" content="{{ page_description | escape }}">
      {% endif %}
  {% endif %}
 
Allen
Mitchellsmith
Tourist
5 0 9

Thank you so much Allen!!

I was able to implement this change and I think it's working.

Happy Holidays!

zippyslothseo
Tourist
4 0 10

 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

getAuriga
Tourist
4 0 5

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!!!

zippyslothseo
Tourist
4 0 10
Individual categories should have their own meta and use a different template, not “list”.

If you have multiple that do use the list template- You could add additional if/else if logic to set different metas by category.

Agree that it should be fixed by Shopify.

As always, make sure to test after implementation.
milu_balan
Shopify Partner
60 0 4

Hi @getAuriga 

Did you find Any solutions for this issue?

cristobalgomez2
Shopify Partner
2 0 6

Thank you!

This didnt work for me right out the bat; but after changing the following it worked:

Original:

 {% if page_description %}
      {% if template == 'collection-list' %}
          <meta name="description" content="YOUR META DESCRIPTION HERE.">
      {% else %}
          <meta name="description" content="{{ page_description | escape }}">
      {% endif %}
  {% endif %}


Changed to:

{%- if page_description -%}
  {% if template == 'list-collections' %}
  <meta name="description" content="YOUR META DESCRIPTION HERE">
  {% else %}
    <meta name="description" content="{{ page_description | escape }}">
  {%- endif -%}
  {%- endif -%}
 


Im currently using the Debut theme. IDK if this is why I had to change it but it is now running and working well.


Thank you again!
Javsan
Visitor
1 0 0

It doesn't work for me 😞

Michael140
Shopify Partner
4 0 3

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

Scouter
Visitor
1 0 0

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

nellyp
Visitor
1 0 0

This worked for the description thank you but not the title, any ideas why? thanks 

Vlad_BA
Shopify Partner
2 0 0

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

LanternSol
Shopify Partner
2 0 0

How do you update the meta title?

Cat_SkillWiz
Visitor
2 0 0

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

Matei_Bogdan
Visitor
1 0 0

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

 

Mitchellsmith
Tourist
5 0 9

I had to type in 'list-collections' to properly target my collections list. (www.voltlin.com/collections)

 

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

DevWise
Shopify Partner
2 0 0

You can use it:

{% if page_description %}
<meta name="description" content="{{ page_description | escape }}">
{% else %}
<meta name="description" content="YOUR CONTENT">
{% endif %}

shqipdonselmani
Shopify Partner
5 0 2

Hi everyone this is the way i made it work

{%- if page_description -%}
  {% if template == 'collection-list' %}
    <meta name="description" content="YOUR META DESCRIPTION HERE">
  {% else %}
    <meta name="description" content="{{ page_description | escape }}">
{%- endif -%}
{%- endif -%}
 
This one is right but with small detail depending on the theme the "list-collections" may be called differently that is the reason why its not working for most of the people.

Thats why go to your code and check for list collection in my case it is named as list-collections
There can be other variations too.

So for me it worked as suggested

{%- if page_description -%}
  {% if template == 'list-collections' %}
    <meta name="description" content="YOUR META DESCRIPTION HERE">
  {% else %}
    <meta name="description" content="{{ page_description | escape }}">
{%- endif -%}
{%- endif -%}

It may seem to some as a duplicate answer just wanted to clarify

shqipdonselmani
Shopify Partner
5 0 2

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

  {% if page_description %}
     <meta name="description" content="{{ page_description | escape }}">
  {% endif %}

to this

{%- if page_description -%}
{% if template == 'list-collections' %}
<meta name="description" content="{{ settings.metadescriptioncollections }}">
{% else %}
<meta name="description" content="{{ page_description | escape }}">
{%- endif -%}
{%- endif -%}

In this way we will be able to dynamically change the meta description for the collection page all the time without touching the code anymore



Henry_Bateman
Tourist
3 0 1

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?

shqipdonselmani
Shopify Partner
5 0 2

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

Henry_Bateman
Tourist
3 0 1
Thanks for the reply, this is what I referring to

Any ideas?


Ben31
Trailblazer
214 8 157

@shqipdonselmani Life saver! Worked perfectly thank you.

Skyscraper
Visitor
1 0 0

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

Vlad_BA
Shopify Partner
2 0 0

Hi Skyscraper,

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

jondiego
Tourist
9 0 1

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.

 

Brookeyd
New Member
6 0 0

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

Cormac_Kerrigan
Shopify Partner
30 1 2

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? 

Brookeyd
New Member
6 0 0

Check you file:  doc-head-core.liquid and you can try updating the code there ( using the above code from Jondiego )

 

Cormac_Kerrigan
Shopify Partner
30 1 2

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

Brookeyd
New Member
6 0 0

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

Cormac_Kerrigan
Shopify Partner
30 1 2

Still doesn't work taking that approach. 

Brookeyd
New Member
6 0 0

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

Cormac_Kerrigan
Shopify Partner
30 1 2

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

Brookeyd
New Member
6 0 0

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.

Cormac_Kerrigan
Shopify Partner
30 1 2

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?

Brookeyd
New Member
6 0 0

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 ?