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

change the meta title and meta description on my main collections page

change the meta title and meta description on my main collections page

afwanfhaider
Tourist
7 0 2

Hi,

 

I have searched the forum and found this question asked in several different ways, but never found a solution on any of the threads.

Hi,

I am trying to change the meta title and meta description on my main collections page (rosagilberto.com/collections) -- without changing anything on the homepage or any other collection.

 

Using Shopify 2.0 Prestige Theme

 

Any ideas?

 

Thanks,

Afwan

Replies 2 (2)

PageFly-Oliver
Shopify Partner
878 190 184

Hi @afwanfhaider ,

You can try using liquid code to check /collections

 

 

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

{% else %}

{% endif %}

 

 

PageFlyOliver_1-1708567777573.png

 



 

Hope my solution works perfectly for you!

Best regards,

Oliver | PageFly

Please let me know if it works by giving it a Like or marking it as a solution!


PageFly - #1 Page Builder for Shopify merchants.


All features are available from Free plan. Live Chat Support is available 24/7.

Webmit
Tourist
5 1 1

Hi Afwan - 

 

I had the same issue and I found this discussion that had several solutions.  

https://community.shopify.com/c/technical-q-a/how-to-edit-the-meta-of-collections-page/m-p/1776435/h...

 

I have implemented the following on my website using the Expanse theme from Shqipdonselmani 

 

Check your theme for the correct reference to the collections list in your theme and modify it if needed to match your template name.

 

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