Why is my SEO check still failing after I added a meta description in my Shopify settings?
This can happen when there is no title code inside your theme. You can add a title to the theme by following the directions below.
Verify that there is no meta description
- View your website
- Right click and select ‘View Page Source’
- Type Control+F (Command+F on a Mac) to open the search box
- Search for <title> in the file to find the different titles in your theme
- You should see that zero results appear
Create a meta description snippet file
- View your themes in Shopify
- Select ‘Actions’ and ‘Edit code’ for your live theme
- Go the the ‘Snippets’ folder
- Click ‘Add a new snippet’
- Call it 'meta'
- Create snippet
- Add the following piece of code to the new snippet file
We always recommend you make a backup of your active theme before making any code changes.
<span style="font-weight: 300;"><!-- meta.liquid snippet --><br></span><span style="font-weight: 300;"> {% assign maxwords = 30 %}</span><br><span style="font-weight: 300;"> {% if template contains 'product' %}</span><br><span style="font-weight: 300;"> <meta name="description" content="{{ product.description | strip_html | strip_newlines | truncatewords: maxwords | escape }}" /></span><br><span style="font-weight: 300;"> {% elsif template contains 'page' %}</span><br><span style="font-weight: 300;"> <meta name="description" content="{{ page.content | strip_html | strip_newlines | truncatewords: maxwords | escape }}" /></span><br><span style="font-weight: 300;"> {% elsif template == 'index' %}</span><br><span style="font-weight: 300;"> {% if shop.description != '' %}</span><br><span style="font-weight: 300;"> <meta name="description" content="{{ shop.description }}" /></span><br><span style="font-weight: 300;"> {% endif %}</span><br><span style="font-weight: 300;"> {% endif %}<br></span><span style="font-weight: 300;"></span><span style="font-weight: 300;"></span><span style="font-weight: 300;"></span>
Add the meta description to the theme
- Open the theme.liquid file
- Add the following piece of code between the <head></head> tags
<span style="font-weight: 400;">{% include 'meta' %}</span>