App to generate meta description for collections

Highlighted
Excursionist
21 0 16

Hi

We use Power Tools, which creates collections automatically for vendor and product types, which is great. However, there are too many of them to manually add meta descriptions to, so I'm looking for an app to do this.

I can find many apps that will do it but they all come bundled with other SEO stuff, particularly structured data, that we don't need. Any suggestions?

Much appreciated.

0 Likes
Highlighted
Excursionist
21 0 16

I just had a thought that I probably don't need an app for this. Essentially I'm just trying to set a generic meta description for collections that haven't had one entered. I would have thought something like this in theme.liquid should do it, but unfortunately it doesn't seem to work!

{% if template contains 'collection' %}
  {% assign meta_data = collection.metafields.global %}
  {% if meta_data.description_tag == '' %}
    <meta name="description" content="Shop the full range of {{ collection.title }}">
  {% endif %}
{% endif %}

0 Likes
Highlighted
Excursionist
21 0 16

Got it!

{% if template contains 'collection' %}
  {% unless page_description %} 
  <meta name="description" content="Shop the full range of {{ collection.title }}"> 
  {% endunless %}
{% endif %}

0 Likes
Highlighted
New Member
7 0 0

Hi Sebastian, I tried to add the code at the very bottom of the theme.liquid and seems like it's not working.  my existing collections' descriptions under Search Engine section are still empty.  Does it only work for new collection??  

0 Likes