Making Your Shopify Site SEO Friendly
June 23rd, 2008 by Zac HeiseyShopify.com is an all-in-one ecommerce solution for users looking for a quick and easy way to begin selling products online. A simple and intuitive system, Shopify allows users to create and customize their own ecommerce website in minutes. Despite it’s appeal, especially among first-time web sellers, Shopify does present some challenges, particularly in areas of SEO.

In dealing with a template-based system such as Shopify, making SEO-friendly changes to your site can be a headache. The main problem in terms of SEO that many users report with Shopify is the difficulty in creating custom Title tags and Meta tags. We recently began optimizing a client’s site that was being hosted on Shopify.com and ran into some similar problems.
After scouring Shopify’s forums, piecing together bits of information, and tweaking the code, we came up with a relatively simple way to include custom tags on your Shopify site.
To create tags, you need to add conditionals to the “theme.liquid” file of your site (bold portion). Here is the technique that we used:
{% case page_title %}
{% when null %}
<title>{{shop.name}} - {{page_title}}</title>
{% when ‘Your Page Title’ %}
<title>Your Custom Title Here</title>
<meta name=”keywords” content=”Your Custom Keywords Here” />
<meta name=”description” content=”Your Custom Description Here” />
{% else %}
<title>{{shop.name}} | {{page_title}}</title>
{% assign maxwords = 20 %}
{% assign indexblog = ‘frontpage’ %}
{% case template %}
{% when ‘collection’ %}
<meta name=”description” content=”{{page_title}}{% if collection.description.size > 0 %}: {{collection.description | strip_html | truncatewords:maxwords}}{% endif %}”/>
<meta name=”keywords” content= “{{collection.title}}{% if collection.tags.size > 0 %}: {{ collection.tags | join: ‘, ‘ }}{% endif %}” />
{% when ‘product’ %}
<meta name=”description” content=”{{page_title}}{% if product.description.size > 0 %}: {{product.description | strip_html | truncatewords:maxwords}}{% endif %}”/>
<meta name=”keywords” content=”{{product.title}}{% if product.tags.size > 0 %}: {{ product.tags | join: ‘, ‘ }}{% endif %}”>
{% when ‘page’ %}
<meta name=”description” content=”{{page_title}}: {{page.content | strip_html | truncatewords:maxwords}}”/>
<meta name=”keywords” content=”{{page_title}}”>
{% when ‘blog’ %}
<meta name=”description” content=”{{page_title}}”/>
<meta name=”keywords” content=”{{page_title}}”>
{% else %}
<meta name=”description” content=”{{shop.name}}{% if blogs.[indexblog].articles.size > 0 %}: {% for article in blogs.[indexblog].articles limit:1 %}{{ article.title }}: {{article.content | strip_html | truncatewords:maxwords}}{% endfor %}{% endif %}”/>
<meta name=”keywords” content= “{% for link in linklists.Main-Menu.links %}{% if link.type == ‘collection_link’ %}{{link.title}} {% endif %}{% endfor %}” />
{% endcase %}
{% endcase %}
Use the bolded conditional statements above for each page that you wish to create customs tags for. For example, if your page was titled “Welcome”, your conditional might look something like this:
{% when ‘Welcome’ %}
<title>T-Shirt Printers | T-Shirt Customization</title>
<meta name=”keywords” content=”t-shirt printing, personalized t-shirts” />
<meta name=”description” content=”Create and customize your own t-shirt” />
This is just one of many ways to create title and meta tags for your Shopify site. There are also several other factors that go into making your Shopify site SEO friendly (internal linking, sitemap, url redirects, etc). Start by creating custom, keyword-focused title and meta tags, and your Shopify site will begin to climb the search engine rankings.







July 8th, 2008 at 11:50 pm
Thanks for the fix! I was able to get it working for the homepage; however, I’m having trouble with the product pages. Should I be adding…
{% when ‘Welcome’ %}
T-Shirt Printers | T-Shirt Customization
to the top of my product page above my 1st paragraph of content? I’m not clear on where this code goes. Also, do I need to modify page.liquid at all?
Thanks again for putting this out there. Shopify rocks, but the SEO functionality is lacking.
July 9th, 2008 at 1:34 pm
Ted,
For our client’s shopify site, all of our work was done on the theme.liquid page. We made no changes to product pages, page.liquid, etc.
You want to place the code between the head tag and body tag on the theme.liquid page. Each page that you wish to add Title and Meta tags to should have a conditional.
Here is an example for a ‘Welcome’ page and a ‘Product 1′ page:
{% case page_title %}
{% when null %}
{% when ‘Welcome’ %}
{% when ‘Product 1′ %}
Use this method for each of your landing pages, then insert the remaining portion of the code before the body tag (the part that comes after the bold section in the article).
July 9th, 2008 at 2:57 pm
Ted,
For our client’s Shopify site, we only made modifications to the theme.liquid page. No changes were made to any products pages or the page.liquid page.
You want to place the code on the theme.liquid page between the head tag and body tag. You are also going to be creating conditionals for each page that you wish to modify the Title and Meta tags for.
Here is an example of the code you would want to place if you were modifying your ‘Welcome’ and ‘Product 1′ pages:
{% case page_title %}
{% when null %}
{% when ‘Welcome’ %}
{% when ‘Product 1′ %}
Once you have completed the above conditionals for all of your landing pages, paste the rest of the code (which is under the bolded conditional in the post) before the body tag.
July 9th, 2008 at 11:23 pm
Zac,
Thanks a ton! That was driving me nuts. I was able to get my first product page to work. Thanks again for posting this article. It was most helpful.
-Ted