Home » How to create your sitemap on Shopify?

How to create your sitemap on Shopify?

Xml Sitemap Shopify

A site’s sitemap file is an HTML or XML file that is your sitemap. That is to say that in this file are all the pages of your site and these are categorized.

This file is useful for referencing the website , so it is important to create it so that all the pages of your site are taken into account by search engines.

In this article we will see in more detail what the sitemap file is, its usefulness and how it can be created with Shopify.

What is a website sitemap?

On Shopify as on any other website, the sitemap is a file that lists all the pages of your site by respecting a categorization of the pages of your site.

You will therefore find, on a sitemap from Shopify:

  • a “products” category for the products on your site,
  • another “collections” for the shop collections
  • and “blogs” for site blog posts.

A sitemap can be present in two different forms: in HTML or in XML.

The HTML sitemap will mainly be used by human visitors to your site and robots to navigate more easily through all of your pages. The links of all the pages of the site will be present on this HTML sitemap.

See also
How to create an internet store as a local artisan or producer?

The XML sitemap will mainly be used by search engines to locate, browse (crawl) and understand the structure of the website.

The XML sitemap is dynamic, it updates with each change in the structure of the site and is most of the time managed automatically by a plugin or by the CMS itself.

It is this sitemap that you will need to submit to Google via the “Google Search Console” to index the pages of your website and allow you to monitor the technical problems of your site.

How to create the sitemap on a Shopify store?

View XML sitemap on Shopify

If your site was created using the Shopify CMS, you won’t have to manage your XML sitemap. Indeed, it is the Shopify system that takes care of creating, managing and updating the XML sitemap of sites created with the CMS.

In return for the delegation of this task by the Shopify system, you will also not be able to modify the XML sitemap of your site.

To see your Shopify sitemap, you need to add “/sitemap.xml” after your store’s domain name.

Thus, to access the XML sitemap of the “maboutique.fr” store, you must write the following URL in the search bar of your browser: “maboutique.fr/sitemap.xml”

See also
How to create a contact pro email with shopify?

Create an HTML sitemap for a Shopify site

However, you can still create the HTML sitemap for your Shopify store!

To do this, you will only have to create a new page on your store and add a file to your theme .
First, you will need to create a new template in the current theme of your Shopify store.

Log in to the administration panel of your site and access the theme code by following the following path “Online store > Themes” then clicking on the “Actions” button and then “Edit code”.

When you have access to the theme files, expand the “Templates” folder and click on the “Add a new template” button (1).

Then, in the pop-up window that opens, select in the first field “page” (2) and in the second field fill in the name of the template to be created which is “sitemap” (3).

Validate the creation of the new template by clicking on the “Create a template” button (4).

Create an HTML sitemap for a Shopify site

The new template file is created under the name “page.sitemap.liquid” with a pre-written code inside. In the initial code of the file is a line “{{ page.content }}”, under which you will have to add a code that will list all the products and collections of your store.

See also
Buying a domain name with Shopify

So add the following code directly under “{{ page.content }}” and before the closing “/div” tag:

<div class="row">
<div class="col-md-6">
<h2>Collections</h2>
<ul>
{% for c in collections %}
<li>
<a href="{{ c.url }}">{{ c.title }}</a>
</li>
{% endfor %}
</ul>
</div>
<div class="col-md-6">
<h2>Products</h2>
<ul>
{% for product in collections.all.products %}
<li>
<a href="{{ product.url }}">{{ product.title }}</a>
</li>
{% endfor %}
</ul>
</div>
</div>

HTMLCopySave the changes made with the “Save” button located at the top right of the code editing area.

Once you have created the “sitemap” template by adding the code above, you can create the page that will contain the sitemap using this new template.

In the side menu of the Shopify store administration panel, click on “Online store” then “Pages” to access the pages of the site. Add a new page to the site by clicking on the “Add a page” button at the top right.

Fill in the title of the page “Site map” (1) but leave the content of the page empty. Select in page template, the newly created template named “page.sitemap” (2) then save the page created with the “Save” button (3).

sitemap Xml Shopify

After creating and saving the page, access it on your site to see the structure of your site displayed in this “Site Map” page.

Add this page at the bottom of the site so that visitors to your store can consult it and easily access the different pages of your site thanks to the links present in the site map.

See also
Shopify Review: Which Platform is Better Between Shopify and WiziShop?

Conclusion

The sitemap is an important file for the indexing of your product pages and landing pages and therefore the referencing of your site. It is also very useful to facilitate the navigation of your visitors.

Since the XML sitemap is automatically generated and maintained by Shopify, you only need to submit it to Google Search Console to help index your pages and monitor technical issues on your site.

All you have to do is set up the sitemap of your store using the HTML sitemap and this article to improve the experience that your visitors will have on your store.

Leave a Reply

Your email address will not be published.