How to implement basic SEO for Shopify themes
This article is an introductory book by our company on Shopify, Hello Shopify Themes: A Guide to Shopify Theme Development Here's an excerpt from .
SEO (Search Engine Optimization) is also an indispensable area for practical use.
The sales requirements in the theme store also include SEO support, so there is no big problem when using Dawn or a third-party theme. There are apps available that allow you to manage your SEO in more detail, so you can consider using them. We recommend following up on Dawn’s SEO-related description for developing original themes, especially note:
- title element
- meta-description element
- canonical URL
- Support for displaying Google Rich Snippets using structured data
Contents [ hidden display ]
title element
Dawnian <title> The element is described as follows:
<title>
{{ page_title }}
{%- if current_tags %} – tagged "{{ current_tags | join: ', ' }}"{% endif -%}
{%- if current_page != 1 %} – Page {{ current_page }}{% endif -%}
{%- unless page_title contains shop.name %} – {{ shop.name }}{% endunless -%}
</title>{{ page_title }} is a Liquid object that outputs titles set on the management screen of products, fixed pages, collections, blog posts and blog posts.
In addition, if tag narrowing or page splitting is made in a collection or blog list page, the current number of tags and pages will be added within the title.
meta-description element
The Dawn meta-description element is: <title> It's simple compared to that.
Liquid object {{ page_description }} is output a description set on the management screen of products, fixed pages, collections, blog posts and blog posts.The description on the top page of the store can be configured from "Online Store" > "Various settings".
{% if page_description %}
<meta name="description" content="{{ page_description | escape }}">
{% endif %}canonical URL
{{ canonical_url }} As for ". 4-4. Theme File Description Also mentioned in the ""Liquid object", which automatically outputs a regular URL of your current page.
<link rel="canonical" href="{{ canonical_url }}">For example, the URL of a product page with variation selection is given as follows:
https://nsw-sample-store.myshopify.com/products/dawn-wildflower?variant=42240097157337 at this rate, the normal page https://nsw-sample-store.myshopify.com/products/dawn-wildflower and a page with variation parameters https://nsw-sample-store.myshopify.com/products/dawn-wildflower?variant=42240097157337 The search engine cannot determine which URL should be registered in the search index.
{{ canonical_url }} The canonical URL is specified as follows, and you can notify the search engine of a valid URL for that page.
<link rel="canonical" href="https://nsw-sample-store.myshopify.com/products/dawn-wildflower">Normally this is fine, but if you add an app to a filter such as a collection page, there are times when the processing of URL normalization is sweet in some apps, so please check it carefully at the time of operation verification.
structured data
In Dawn, structured data in JSON-LD format can be used to display Google rich snippets within Liquid. <script type="application/ld+json"> Since the element is written in structured data, be careful not to accidentally delete it when customizing.
Dawn contains a description of structured data on the next page, and if you want to add more structured data than those pages, please add it based on Google’s documentation about structured data.
- product page
- blog post page
- The whole site (Organization, website, SearchAction information)
robots.txt
Shopify By default robots.txt is currently being applied to the store. robots.txt You can check the contents of "*" at the following URL.
https://ストアドメイン.myshopify.com/robots.txt default robots.txt To add customization to . templates/robots.txt.liquid Use the file, because it is a file that was not originally included in the theme, please create yourself. robots.txt.liquid 0 theme needs to be created in Liquid format, it does not support JSON format.
For a specific description example, see the official documentation sample.
Customize robots.txt
https://shopify.dev/themes/seo/robots-txt
Click here to purchase the introductory book on Shopify theme development that we produced at our company.
We do not have any plans for printing after the sale at this time, so if you would like to read a printed book please pick us up as soon as possible.
- Author: Sayaka Kawashima
- Publishing: Non-standard world, Inc.
- Number of pages: B5, 248
- Price: 3,850 yen (tax included) * Packed with PDF version, free shipping