How to create an XML sitemap and submit to search engines

Published:

Last updated:

how to create an xml sitemap
Home » Articles » Web Development » How to create an XML sitemap and submit to search engines

If you are running a website and care about SEO, we recommend you get familiar with the term “XML sitemap”. 

What is an XML Sitemap?

A Sitemap XML is well.. A map of a website, saved with a “.xml” file extension. It is a single list of all pages on a website, or a collection of files (for example: pages, posts, media etc) that include all the URLs on the website.  Moreover, a Sitemap XML can provide you with metadata. including URL information, last modification dates (<lastmod>), change frequency (<changefreq>), and priority (<priority>). This means search engines can find and connect to all the pages listed in the Sitemap XML. 

What is the purpose of having an XML sitemap?

An xml sitemap’s key role is to help the search engines find and index your pages faster. If some of your pages are not indexed yet, a xml sitemap can help these pages be discovered by Google  It also offers information such as: the last time the website was updated, the frequency of page changes, and how the website content is structured 

Why should you keep the XML sitemap up-to-date?

Keeping the sitemap up-to-date is important. It gives search engines a map of your website’s latest content. This map helps them find and understand all the different pages on your site. By regularly updating this map, you make sure search engines can easily discover and show your most recent content to people searching online.

Understanding XML Sitemap Structure

In an XML Sitemap, each part has its own job to give more details about the pages on your website. Understanding the structure of a sitemap can help us to identify if our sitemap is complete and can help us troubleshoot any errors with the sitemap. Here are the main parts:

– `<urlset>`: The root element of the sitemap.

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

– `<url>`: A child element of `<urlset>` that represents a single URL.

<url>
</url>

– `<loc>`: A child element of `<url>` that specifies the URL of the page.

<loc>http://www.example.com/</loc>

– `<lastmod>`: A child element of `<url>` that specifies the date the page was last modified

<lastmod>2024-01-01</lastmod>

– `<changefreq>`: A child element of `<url>` that specifies how often the page is changed.

<changefreq>weekly</changefreq>

– `<priority>`: A child element of `<url>` that specifies the priority of the page.

<priority>1.0</priority>

– `<image>`: A child element of `<url>` that specifies the image associated with the page.

<image:image>
  <image:loc>http://www.example.com/image.jpg</image:loc>
</image:image>

– `<video>`: A child element of `<url>` that specifies the video associated with the page.

<video:video>
  <video:content_loc>http://www.example.com/video.mp4</video:content_loc>
</video:video>

Example of a sitemap

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
      <loc>http://www.example.com/</loc>
      <lastmod>2023-01-01</lastmod>
      <changefreq>monthly</changefreq>
      <priority>1.0</priority>
  </url>
  <url>
      <loc>http://www.example.com/about</loc>
      <lastmod>2023-01-10</lastmod>
      <changefreq>yearly</changefreq>
      <priority>0.8</priority>
  </url>
  <url>
      <loc>http://www.example.com/contact</loc>
      <lastmod>2023-02-01</lastmod>
      <changefreq>yearly</changefreq>
      <priority>0.5</priority>
  </url>
</urlset>

How to create an XML Sitemap 

You can create an XML sitemap easily via a plugin or manually create it. The preferred method is using a plugin as it automatically makes a good one for you. Here are some plugins that help create XML sitemaps on WordPress, Webflow, and Shopify.

How to create XML sitemap on WordPress

WordPress, the most popular website builder, has many good plugins to create XML sitemaps. Choose a plugin that is reputable and frequently updated, and also easy to use. We recommend the following two:

YoastSEO

One of the most popular plugin on WordPress that can help generate an XML sitemap. After installing and activating the plugin, you can follow these steps to create a sitemap

  • Go to your WordPress dashboard.
  • Navigate to “SEO” in the left-hand menu and select “General.”
  • Click on the “Features” tab.
  • Find the “XML Sitemaps” toggle switch and ensure it is set to “On.”
  • Save changes.
  • Go back to the “General” tab under “SEO.”
  • Click on the question mark next to the XML Sitemaps feature and then click on “See the XML sitemap.”
  • Your sitemap will be located at http://yourdomain.com/sitemap_index.xml.

XML Sitemap Generator for Google

Another plugin is XML Sitemap Generator for Google. Here’s how to use it: 

  • Navigate to “Settings” in the left-hand menu.
  • Click on “XML-Sitemap.”
  • Adjust settings according to your preferences (e.g., exclude certain content types, set priorities, and frequencies).
  • Save changes.
  • Your sitemap will be located at http://yourdomain.com/sitemap.xml.
what is xml sitemap generator for google

How to create XML sitemap on Shopify

Having an XML sitemap for your Shopify store is important because it helps search engines like Google find all your product and content pages. This makes it easier for customers to discover your store when they search online. Here are some plugins to create an XML sitemap. Fortunately, Shopify automatically generates a sitemap for all website owners. The sitemap has links to your products, images, pages,etc. If you have the Basic plan or higher, you’ll get sitemaps for each extra domain you use for international sites. If you’re not using these extra domains for different countries, make sure they all redirect to your main website. You can learn more about it here: Shopify Sitemap. In case, you want to create a custom sitemap on your own, there are plugins available

Smart SEO

  • Go to your Shopify admin dashboard.
  • Navigate to “Apps” and click on “Smart SEO.”
  • In the Smart SEO dashboard, find the section for XML sitemaps.
  • Customise the sitemap settings if needed, such as including/excluding certain products or collections.
  • Save your settings.
  • The sitemap will be generated automatically.

SEO Manager

  • Go to your Shopify admin dashboard.
  • Navigate to “Apps” and click on “SEO Manager.”
  • In the SEO Manager dashboard, go to the sitemap section.
  • Adjust settings as needed.
  • Save your changes.
  • The sitemap will be generated and updated automatically.

How to create XML sitemap on Webflow

If you are a Webflow user, the job is pretty easy. Webflow doesn’t support traditional plugins in the same way that platforms like WordPress or Shopify do, but it has built-in features and third-party integrations that can help you create and manage an XML sitemap. Here are two methods to create an XML sitemap in Webflow:

Using Webflow Built-in sitemap generator

  • Go to your Webflow dashboard and open your project.
  • Click on the “Settings” icon next to your project.
  • Go to the “SEO” tab.
  • Scroll down to the “Sitemap” section.
  • Toggle the “Generate Sitemap” switch to “On.”
  • Customise the sitemap settings if necessary, such as excluding specific pages.
  • Click on the “Publish” button to ensure the sitemap is updated

Extra: you can add a custom sitemap by doing these steps 

  • Visit Site settings > SEO tab > Sitemap section
  • Toggle Auto-generate sitemap to “No” to disable the auto-generated sitemap 
  • Paste your custom sitemap in the Custom sitemap.xml field
  • Click Save changes
  • Publish your site

Using Flowmap (third-party tool)

Another option is going to the FlowMap website and log in to your account.

  • Connect your Webflow project to FlowMap.
  • Customize the settings according to your preferences, such as which pages to include in the sitemap.
  • Save your settings.
  • The sitemap will be generated and updated based on your preferences.

How to submit an XML sitemap?

After creating an XML sitemap, you need to submit it to search engines so that your site can be crawled quickly and efficiently. There are two tools you can use for this: Google Search Console and Bing Webmaster Tools.

Google Search Console:

  • Log in to Google Search Console.
  • Select your website property.
  • Navigate to the “Sitemaps” section.
  • Enter the URL of your sitemap (e.g., http://www.example.com/sitemap.xml) and submit it.

Bing Webmaster Tools:

  • Log in to Bing Webmaster Tools.
  • Select your website property.
  • Go to the “Sitemaps” section.
  • Enter the URL of your sitemap and submit it.

Advanced XML sitemap FAQs

How should I set up my website’s XML Sitemap if it’s really big?

If your website is extremely large, covering more than 50,000 pages it’s best to split your sitemap into smaller sections, with each part containing not more than 50,000 URLs or 50MB in size. Think of it like creating smaller chapters in a big book and then using a contents page to link them together.. ake sure to list the most important pages first and group similar pages together.

How does the use of hreflang annotations impact XML Sitemaps, especially for multilingual and international websites?

XML Sitemaps should include hreflang annotations for multilingual and international sites to signal to search engines the language and regional targeting of each URL. Ensure consistency between hreflang annotations in the XML Sitemap and those in the HTML source code to avoid confusion and improve SEO performance.

Add Kahunam to your team. We'll help you build a new website that helps you crush your goals. Or we'll help you take your existing website to the next level — leaving your competitors falling behind.