How To Create an XML Sitemap To Improve Your Website’s SEO (2023) - Shopify

If you own a website, you may think it's obvious how to find every page on your site. In reality, it's easy for users and search engines to overlook pages, meaning you can miss out on organic traffic and chances for visitors to connect with your content. That's where your XML sitemap comes into play. Learn why it's important to have an XML sitemap and how to set one up. 

What is an XML sitemap?

An XML sitemap lays out every public-facing page on your website. XML is a simple, text-based file format that enables search engine crawlers to easily read your website.

XML sitemaps can be one URL that lists every page on a website, or they can feature parent-child relationships, in which one parent sitemap links out to multiple sitemaps. The child individual sitemaps typically organize pages by subfolder or page type. For example, Shopify stores automatically generate separate child sitemaps for products, collections, pages, and blog posts.

XML sitemap example

Most sites have publicly accessible sitemaps that you can find at domain.com/sitemap.xml or similar addresses. Below is an example of the parent sitemap (mylola.com/sitemap.xml) for Lola, a wellness and reproductive health company:

<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

    <!-- This is the parent sitemap linking to additional sitemaps for products, collections and pages as shown below. The sitemap can not be edited manually, but is kept up to date in real time. -->

    <sitemap>

        <loc>https://mylola.com/sitemap_products_1.xml?from=413574791211&to=6916825776174</loc>

    </sitemap>

    <sitemap>

        <loc>https://mylola.com/sitemap_pages_1.xml</loc>

    </sitemap>

    <sitemap>

        <loc>https://mylola.com/sitemap_collections_1.xml</loc>

    </sitemap>

    <sitemap>

        <loc>https://mylola.com/sitemap_blogs_1.xml</loc>

    </sitemap>

</sitemapindex>

It starts with an initial declaration indicating it follows the conventions for sitemaps (laid out here). Then it has a comment line describing its purpose, followed by a list of the locations of the four child sitemaps. 

Below is a sample of Lola's collections sitemap. It has more than 50 sitemap URLs. Below are the first three:

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">

    <url>

        <loc>https://mylola.com/collections/cramps</loc>

        <lastmod>2023-11-04T14:00:48-04:00</lastmod>

        <changefreq>daily</changefreq>

        <image:image>

            <image:loc>https://cdn.shopify.com/s/files/1/2568/9396/collections/LOLA-Cramp-Care.jpg?v=1574110262</image:loc>

            <image:title>PMS Products</image:title>

        </image:image>

    </url>

    <url>

        <loc>https://mylola.com/collections/periods</loc>

        <lastmod>2023-11-04T16:05:23-04:00</lastmod>

        <changefreq>daily</changefreq>

        <image:image>

            <image:loc>https://cdn.shopify.com/s/files/1/2568/9396/collections/LOLA-Period.jpg?v=1574689545</image:loc>

            <image:title>Clean Period Products</image:title>

        </image:image>

    </url>

    <url>

        <loc>https://mylola.com/collections/sex</loc>

        <lastmod>2023-11-04T16:05:23-04:00</lastmod>

        <changefreq>daily</changefreq>

        <image:image>

            <image:loc>https://cdn.shopify.com/s/files/1/2568/9396/collections/LOLA-Sex.jpg?v=1574110088</image:loc>

            <image:title>Women's Sexual Wellness Products</image:title>

        </image:image>

    </url>

For each of the three URLs, it lists the URL, the date when someone last modified the page, and the primary image and image title for the page. This information is primarily for search engines—it helps their crawlers determine when to re-crawl the page. 

Why is it important to have a XML sitemap?

The primary benefit of an XML sitemap is search engine optimization (SEO), which helps websites rank on Google, Bing, and other platforms. Search engines use crawlers to understand a website and all its pages. 

Arthur Camberlein, technical SEO and data specialist at Shopify, can't emphasize enough the importance of spending time on creating your XML sitemap. "An XML sitemap aids SEO by acting as a roadmap for search engines, ensuring they can find and index all important pages on a website," he says. "It helps in quickly discovering and indexing new or updated content. … For webmasters and SEO managers, it assists in identifying and fixing website errors, improving user experience and search engine rankings."

Without a sitemap, crawlers can only discover a website's pages by following the links on each page. This leads to two issues: missing pages that they should index (such as those not commonly linked on a page) and indexing pages that they shouldn't, such as old, irrelevant landing pages or private pages.

An XML sitemap acts as an easy-to-read map for crawlers, showing them a complete list of the pages the website owner wants the crawler to index. This helps crawlers prioritize essential pages and ignore irrelevant pages. 

To increase SEO value, submit your sitemap to Google Search Console to ensure the search engine properly discovers it. You can further ensure your sitemap gets discovered by referring to it in the robots.txt file (Shopify does this by default).

XML sitemaps can also benefit marketers. The simple layout makes it easy to review and organize content. It can help marketers identify duplicated, outdated, or irrelevant content.

Types of XML sitemaps

The most common type of XML sitemap is the standard XML sitemap index, which lists every link on your website. This type of sitemap doesn't break down the type of pages that exist on the website and provides a few automatic pieces of context about each page, such as <loc> (the URL of the page), <lastmod> (date of last modification), and <changefreq> (how often a crawler should check the page for changes).

However, there are other types of sitemaps for specific use cases:

Image sitemap

This type of sitemap indexes images on a website. By providing additional details such as the type of image, subject matter, caption, title, geographical location, and license, this sitemap can help search engines discover images that they might not otherwise find. It also provides enough context for crawlers to better understand the images, making it more likely they appear in image search results. 

Not all websites need an image sitemap—it's best reserved for image-first sites such as ecommerce, photography, or stock image websites.

Video sitemap

For websites that host a high volume of videos, a video sitemap can provide search engines with details about video content. Information can include the video title, description, play page URL, thumbnail, and raw video file location.

Google News sitemap

Specifically for websites that appear on Google News, this sitemap ensures Google News picks up on new articles quickly. Timeliness of indexing is much more pressing for news outlets than for the average website. The sitemap provides details like the article's title, publication date, and keywords.

Mobile sitemap

Designed for websites with separate URLs for mobile content, this type of sitemap helps search engines find and index mobile-specific versions of your web pages. These are no longer common, as websites favor responsive, mobile-first design practices.

Hreflang sitemap 

For websites with multiple language versions or that serve different regions, an hreflang sitemap can indicate to search engines which versions of a page are in which language or intended for which region.

Ways to create an XML sitemap

Here are three common ways to create an XML sitemap: 

CMS-generated sitemaps

A content management system (CMS) allows website owners to create and manage content. Many modern CMSs, including Shopify, will automatically generate and host an XML file. Shopify hosts its websites' parent sitemap at domain.com/sitemap.xml, plus additional sitemaps for every additional domain you are using for international domains. Other CMSs follow a similar convention. 

Shopify automatically includes every product, collection, page, or article with a status set to "active" and a sales channel that includes "online store." If you do not want a page on your website to be in your sitemap, you can use these functions to remove them.

Plug-in/app-generated sitemaps

For CMSs that don't automatically generate sitemaps or for marketers who want more customization over their sitemaps without creating them manually, there are plug-ins or apps available that act as automatic sitemap generators.

If you use an app or plugin, pay extra care to the settings to ensure it accomplishes what you need. Also, note whether it's replacing any CMS-generated sitemap so you don't have duplicate sitemaps because this can confuse search engine crawlers.

Manually generated sitemaps

Marketers can also create their own sitemap. The downside is that this method requires constant maintenance to stay up to date. 

XML sitemap FAQ

How do you create a sitemap using Shopify?

Shopify automatically generates XML sitemap files at yourdomain.com/sitemap.xml. Your sitemap will be available as soon as you publish your website.

What is the difference between XML and HTML sitemaps?

You create XML sitemaps with an XML format; they aid search engines in discoverability. Meanwhile, you create HTML sitemaps using HTML; they aid crawlability (reducing crawl depth).

Is an XML sitemap limited?

Yes, an XML sitemap is limited in terms of size (50 MB uncompressed) and numbers of URLs (50,000). It means that if a limit is reached (either one of them), search engines will stop crawling the content after this limit.

How do you submit your XML sitemap to Google?

To submit your XML sitemap to Google, start by registering with Google Search Console and verifying that you own your website. Then, you can submit your sitemap's URL under the Sitemap section of Google Search Console's settings.

Comments

ads T

Popular posts from this blog

8 best dark web search engines for 2021 - HackRead

DuckDuckGo's privacy-focused browser is available for Windows now - The Verge