How to create and optimise a sitemap for effective SEO?
A sitemap file is an essential element for organic search (SEO). It helps search engines crawl and index the pages of your site more effectively. When properly configured, it can improve the visibility of your content and speed up its indexing.
In this article, we will explain what a sitemap is, why it is indispensable, and how to create, configure and optimise it to maximise your SEO.
In this article:
ToggleWhat is a sitemap?
A sitemap is a file, usually in XML format, that lists all of a website's URLs. It serves as a guide for search engine bots (such as Googlebot), telling them which pages to index and how often they are updated.
There are different types of sitemaps:
- XML sitemap: Used for search engines.
- HTML sitemap: Aimed at users to make navigation easier.
- Image and video sitemap: Helps optimise the indexing of media.
Why is a sitemap essential for SEO?
A well-designed sitemap offers several benefits:
- Better indexing: It helps search engines quickly discover new pages and updates.
- Crawl optimisation: Google and other search engines allocate a limited crawl budget to each site. A sitemap makes their job easier by prioritising the important pages.
- Resolving indexing issues: If certain pages are not accessible through internal linking, the sitemap lets you flag them directly to the search engines.
How do you create an XML sitemap file?
1. Automatic generation
The simplest way to create a sitemap is to use an automatic generator, in particular:
- WordPress plugins: Yoast SEO, Rank Math, All in One SEO.
- Online tools: Screaming Frog, XML-Sitemaps.com.
- CMSs and e-commerce platforms: Shopify, Prestashop and Magento often offer automatic generation.
2. Manual generation
To create an XML sitemap by hand, here is an example of a basic structure:
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>https://www.example.com/</loc> <lastmod>2024-02-20</lastmod> <changefreq>daily</changefreq> <priority>1.0</priority> </url> <url> <loc>https://www.example.com/page1/</loc> <lastmod>2024-02-19</lastmod> <changefreq>weekly</changefreq> <priority>0.8</priority> </url> </urlset>
Explanation of the XML sitemap parameters
1. The <lastmod> parameter
The <lastmod> parameter indicates the last modification date of a page. This field lets search engines know when a page was updated, so they avoid needlessly crawling unchanged pages. It is advisable to use the ISO 8601 format (YYYY-MM-DD) to ensure compatibility with search engines.
2. The <priority> parameter
The <priority> parameter defines the relative importance of a page compared with the other pages on the site. It ranges between 0.0 and 1.0, where 1.0 corresponds to the most important pages (such as the home page). However, Google does not guarantee that it will take this priority into account, but it may use it as guidance during crawling.
3. The <changefreq> parameter
The <changefreq> parameter specifies the approximate update frequency of a page. The possible values are always, hourly, daily, weekly, monthly, yearly, and never. Although this parameter provides guidance to search engines, Google does not always use it as the main criterion for deciding crawl frequency.
Using extensions on popular CMSs
WordPress
WordPress users can generate an XML sitemap by installing plugins such as Yoast SEO, Rank Math or All in One SEO. These extensions automatically create a sitemap file that is updated as new pages and posts are added.
Prestashop
On Prestashop, the Google Sitemap Module extension lets you generate a sitemap and update it regularly. You simply need to activate it and configure the settings to ensure that all important pages are included.
Shopify
Shopify automatically generates a sitemap.xml file for each online store. This file is accessible at https://your-store.com/sitemap.xml and is updated automatically when new products or pages are added.
Magento
Magento offers a native XML sitemap creation feature. In the admin interface, you can configure and schedule automatic sitemap generation under Marketing > SEO & Search > Site Map.

How do you configure your sitemap correctly?
1. Upload the sitemap file to your server
Once generated, upload your sitemap.xml file to the root of your site, for example: https://www.example.com/sitemap.xml.
2. Declare the sitemap to Google
To inform Google about your sitemap:
- Go to Google Search Console.
- Go to "Sitemaps".
- Enter your sitemap URL and click "Submit".
3. Add a link in the robots.txt file
You can help the bots by adding this line to your robots.txt file:
Sitemap: https://www.example.com/sitemap.xml
How do you submit your sitemaps to Google and Bing?
To submit your sitemap to Google, use Google Search Console. Log in to your account, select your website, then go to the "Sitemaps" section. Enter the URL of your sitemap file (for example, https://www.example.com/sitemap.xml) and click "Submit". Google will then analyse your file and add it to its index.
Bing
For Bing, use the Bing Webmaster Tools tool. Log in to your account, select your website and go to the "Sitemaps" option under "Configure My Site". Add your sitemap URL and confirm. Bing will then take your file into account to index your pages more efficiently.
Analysing the performance of your sitemaps
Google Search Console
Google Search Console lets you monitor the performance of your sitemap. In the "Sitemaps" section, you can see how many URLs have been submitted and how many have actually been indexed. The tool also flags potential errors, such as URLs blocked by the robots.txt file or 404 errors. Remember to check this tab regularly to optimise the indexing of your pages.
Bing Webmaster Tools
Bing Webmaster Tools also offers detailed tracking of your sitemap. The tool displays the number of URLs discovered, indexed and any issues encountered. It also provides recommendations to improve your sitemap and ensure better indexing of your pages on Bing. By using this tool, you make sure that your site is properly taken into account by Microsoft's search engine.
Advanced sitemap optimisation
- Limit the number of URLs: Google recommends a maximum of 50,000 URLs per file.
- Split the sitemap: If you have a large site, create several sitemaps (e.g. articles, categories, images).
- Use Gzip compression: To reduce the file size and speed up crawling.
- Keep the sitemap up to date: Remove obsolete pages and update the modification dates.
-
Prioritise strategic pages: Adjust the
<priority>tags to influence the crawl order.
Optimising your XML sitemap for Google News
Google News has specific requirements for sitemaps to ensure fast indexing of news content. Here are a few best practices to optimise your XML sitemap for Google News:
- Create a dedicated news sitemap: Unlike the main sitemap, the Google News sitemap should only include articles published within the last 48 hours.
-
Follow the required structure: Google News requires certain specific tags such as
<news:news>,<news:publication>,<news:title>, and<news:publication_date>. - Limit the number of articles: A Google News sitemap should contain a maximum of 1,000 recent articles.
- Update it frequently: New publications should be added to the sitemap as soon as they are published to maximise their fast indexing.
- Declare the sitemap in Google Search Console: Once created, the file should be submitted via Google Search Console so it is taken into account quickly.
Here is an example of a Google News sitemap:
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"> <url> <loc>https://www.example.com/article1</loc> <news:news> <news:publication> <news:name>Site Name</news:name> <news:language>en</news:language> </news:publication> <news:title>Article Title</news:title> <news:publication_date>2024-02-20</news:publication_date> </news:news> </url> </urlset>
Conclusion
A well-built, optimised sitemap is a powerful asset for your SEO strategy. It helps search engines crawl your site more efficiently and speed up the indexing of your important pages. Don't forget to update it regularly and monitor it via Google Search Console to continuously optimise your visibility on the web.



