Changing Meta description and title on collection page only (in theme code)

pacarter11
Tourist
18 0 1

Hi,

I am trying to change the meta description and title on the collection page ONLY.

 

I am trying this piece of code (in the theme.liquid) but its not working and I am not sure why:

{% if template contains 'collection' and collection.url == '/collections/' %} <meta name="description" content="Shop for your Shaker or Period English solid wood kitchen cabinets - Handmade to order, buy on-line - DIY Kitchens" />
<title>DIY KItchens Buy Online | Quality Solid Wood Kitchens | SHOP Now</title> {% else %}
<meta name="description" content="{{ page_description | escape }}" />
{% endif %}

 

I did try 

    {% if template contains 'collection' %} which worked but it also changed every page after the trailing slash (for example /collections/larder-cupboard). But I only want to change this page. Can anyone help?

Replies 11 (11)
oscprofessional
Shopify Partner
11542 1808 2314

Hello ,
Please share your site url.
So that i can check and provide you exact solution here.

Please Like and Accept Solution. Free website audit to grow your business Chat on WhatsApp | Email: pallavi@oscprofessionals.com | Skype : oscprofessionals-87 | Hire us | Expert Site Speed Optimization | Performance Site Audit | Shopify Private App | Custom Theme Development & Modifications any Shopify Theme | Shopify SEO | Digital Marketing
pacarter11
Tourist
18 0 1
jackyle
Explorer
71 1 9

I think you should ask questions on deeply related websites about IT, there are those who specialize in programming who will help you fix this error better.

pacarter11
Tourist
18 0 1
Shubhi_02
Shopify Expert
10 0 2

Hi Pacarter11,

To update the meta-information of your "collections" page, simply update the meta-information of the "Home Page" of your store.

To update the optimised meta information of the Home Page of your store, simply:

Online Store---> Preferences--> Home Page.

Relax and remember that the meta-information on the Home Page will automatically reflect on the "collections" page.

Shubhihasani
FuFei
Pathfinder
82 5 16

Are you trying to change it so that

  1. Every new collections in the future has the same meta description or
  2. Just this one particular page?

If it is number (2), head to this page, scroll to "Search engine listing preview" and edit this part.

Screenshot 2019-12-18 at 4.07.12 PM.png

Working on...
1. Product Lens (App that helps the middle of the funnel marketing)
2. Strategy + Tactics: Marketing Blog
3. Want store feedback? Try this free tool (You gotta give to receive)
4. 60-day SEO email course
5. FB Marketing 102 email newsletter
pacarter11
Tourist
18 0 1

Hi 

I work in SEO and I am trying to stop Duplicate meta descriptions that are harming the site. I want the collections page to have its own unique meta title and description, not pulling from the home page.

 

Is this possible? I have been trying to sort this out for two weeks and it seems nobody has a solution. I know this is possible in wordpress with wo-commerce. Shopify seems less flexible.

pacarter11
Tourist
18 0 1

Hi 

Thanks for replying. Yes, that would be much easier, but the Collection page is a template, not a page, so a bit of coding is required. 😉

We should have the flexibility to do this, but I am finding Shopify to be quite restrictive for proper SEO to be implemented when so many pages become duplicate content when pulled from the homepage.

FuFei
Pathfinder
82 5 16

Are you using a custom theme?

 

Working on...
1. Product Lens (App that helps the middle of the funnel marketing)
2. Strategy + Tactics: Marketing Blog
3. Want store feedback? Try this free tool (You gotta give to receive)
4. 60-day SEO email course
5. FB Marketing 102 email newsletter
Shubhi_02
Shopify Expert
10 0 2

Hi, you are correct to have mentioned that it is possible to have a unique meta-information for each page on Wordpress. However, it isn't possible o Shopify.
It auto fetches the meta-information of the Home Page and places the same as the meta-information of the collections page.

Shubhihasani
MobNation
New Member
1 0 0

How would I change my title and meta description for when my brand is searched on google. when i started using shopify couple months ago i was new so i didnt know gte to make the meta description and title as professional as possible.