How to create a sitemap and submit it to Google
A website’s searchability plays an important role in its success. To help search engines like Google find your site, you’ll need to generate a sitemap. Think of a sitemap as your webpage’s table of contents that will guide search engine crawlers to index your most valuable pages.
In this guide, we’ll show you how to create a sitemap for your website. We’ll also include steps in submitting it to Google Search Console and some best practices when generating your sitemaps.
What is a sitemap?
A sitemap is a file where you input information about your website’s content and how each resource relates to one another. This file helps search engines understand your site’s structure to find and index your content quickly and efficiently.
There are two main types of sitemaps: Extensible Markup Language (XML), which we’ll be focusing on in this article, and Hypertext Markup Language (HTML).
XML sitemaps
These files contain technical details about your site content for search engines to read. The information usually consists of recent page updates and the frequency of those changes. An XML sitemap also ensures that important pages, like landing pages or blog posts, are prioritized during indexing.
Additionally, an XML file can contain specialized sections for specific content types, such as:
- Image sitemaps. This section helps search engines index your site’s images for image search.
- Video sitemaps. Video sitemaps provide metadata like titles, descriptions, and duration to improve video visibility.
- News sitemaps. These sitemaps help Google News prioritize recent articles.
HTML sitemaps
On the other hand, HTML sitemaps are created for visitors. They give users a simple, clickable list of all your website’s major sections, which makes navigation easier. This improves user experience (UX), reduces frustration, and encourages them to stay longer and explore more.
HTML files generally include the following:
- Key website sections (e.g., Home page, About Us page)
- Subcategories (e.g., a Services section might include Web Development and Graphic Design)
- Internal links
How do you create an XML sitemap?
You can generate your website’s sitemap in various ways. Three of these methods include using a plugin, leveraging online tools, or creating it manually. Explore these approaches to determine which technique best fits your skills and needs.
Using plugins (for WordPress)
If you have a WordPress website, you can use plugins to simplify sitemap creation. Plugins like Yoast SEO automate the process, ensuring your sitemap is accurate, updated, and ready for search engines.
Step-by-step guide for using Yoast SEO
Yoast SEO is one of the most popular WordPress plugins for SEO, and its sitemap feature is built-in. Follow these steps to create your sitemap with Yoast SEO:
Step 1: Install and activate Yoast SEO
- Go to your WordPress dashboard.
- Navigate to Plugins, and then click Add New.
- On the Search bar, type Yoast SEO.
- Click Install Now.
- Then, hit Activate.
Step 2: Enable the sitemap feature
- In your WordPress dashboard, navigate to Yoast SEO, click General, then click the Site Features tab.
- Scroll down to the APIs’ section. There, you’ll find the XML sitemaps feature.
- Turn on the feature if it isn’t already enabled.
Step 3: View your sitemap
- Once enabled, Yoast SEO automatically generates your XML sitemap.
- To access the sitemap, click the View the XML sitemap button.
Then, it will take you to a page that looks like this:
Step 4: Customize your sitemap
To adjust what to include in the sitemap, go to Yoast SEO, Settings, and then Content Types.
Here, you can include or exclude specific post types, pages, or taxonomies (categories and tags).
Other common settings you can modify include automatically adding images to your sitemap and setting the frequency of search engines checking specific pages.
Benefits of plugin sitemap generators
Ease of use
With plugins, you won’t need coding skills to create a sitemap. They provide user-friendly dashboards with clear options to adjust and manage your sitemap settings. This makes it an ideal choice for beginners and busy site owners.
Search Engine Optimization (SEO) integration
Many sitemap plugins integrate seamlessly with other SEO features like keyword analysis, meta descriptions, and readability checks. This all-in-one functionality makes it easier to manage your site’s SEO strategy in one place. By combining tools, you can enhance visibility and performance in search engine results.
Error reduction
Plugins reduce common mistakes like broken links, duplicate URLs, or formatting issues that are usually found in manually created sitemaps. They validate your sitemap structure to ensure it meets search engine requirements. This improves the accuracy and effectiveness of your site’s indexing process.
Leveraging online tools
Perhaps you don’t use WordPress, but you still want to find an easy way to generate your website sitemap. You can use online tools instead.
Tools like Screaming Frog are best for generating and exporting sitemaps with minimal effort. They have a free version that allows you to create sitemaps for up to 500 URLs.
Step-by-step guide for using Screaming Frog
Screaming Frog’s SEO Spider tool is a beginner-friendly sitemap generator. Use this guide to help you get started:
Step 1: Download and install the SEO Spider tool
- Head to the Screaming Frog website and click the SEO Spider Tool button.
- In the next page, click Download.
- After downloading the SEO Spider installation file, double-click the document and follow the installation instructions.
Step 2: Crawl your website
After the installation, open the application and input your website URL into the search bar. Then, click Start to begin the crawling process. The SEO Spider tool will scan your site and identify all the pages, images, and other files.
Step 3: Access the XML sitemap options
Once the crawling process is complete, click Sitemaps, and then click XML Sitemap in the top menu. This will open a window with sitemap configuration options.
Step 4: Select pages to include and exclude
In this step, include or exclude pages based on your preference. Simply tick the box for the ones you want in your sitemap and untick the ones you want excluded.
Generally, we recommend you include the following pages in your sitemap:
- Important content pages. Include high-value pages like your homepage, service pages, product pages, and blog posts. These are the pages you want search engines to focus on.
- Unique and canonical URLs. Only retain unique pages with valuable content. If multiple URLs lead to the same page, make sure the canonical version is included.
- Frequently updated pages. Prioritize pages that regularly get new content, such as a blog or news section, for crawling and indexing.
- Pages with search intent. Include pages that align with your audience’s search queries to boost visibility.
Alternately, exclude these pages from your sitemap:
- Duplicate pages. Avoid including pages that offer the same or similar content to prevent confusion for search engines.
- Redirects (3XX). Redirected URLs shouldn’t be included since they point to another destination.
- Noindex pages. Pages with a noindex directive are not meant for indexing, so they should be excluded to align with your SEO strategy.
- Error pages (4XX and 5XX). Pages with errors (e.g., 404 Not Found or 500 Server Errors) should not be included as they don’t provide value.
Step 5: Generate the sitemap
After customizing the content of your sitemap, click the Next button to create your website’s sitemap.
Step 6: Save and export the sitemap
Once your sitemap is generated, a window will prompt you to save the file. First, select a folder on your computer where you want to store the sitemap file. It’s a good idea to use a folder dedicated to website backups or SEO files so you can easily find it later. Then, click the Save button to proceed.
Ensure the file is named ‘sitemap.xml’ or a similar descriptive label. The name matters because search engine crawlers look for ‘sitemap.xml’ by default when accessing your website.
Step 7: Upload the sitemap to your website
Uploading the sitemap to your website ensures search engines can find it and crawl your site effectively.
- Access your site’s root directory using an FTP client like FileZilla or your hosting provider’s file manager.
- Locate the sitemap.xml file on your computer and drag it into the root directory in FileZilla or your hosting’s file manager.
- Double-check that the file is placed directly in the root folder, not in a subfolder like ‘/images’ or ‘/blog.’
- Then, to confirm you’ve uploaded the sitemap properly, open a browser and navigate to https:// [input your website here] /sitemap.xml. If the upload was successful, you should see the sitemap displayed as an XML file with the correct structure, like the image below.
Other online sitemap generators
- XML-Sitemaps.com (free and paid)
This online generator creates sitemaps quickly for smaller websites (up to 500 pages for free). Paid versions support larger sites and advanced options like priority and frequency settings.
- SEOptimer (free)
This simple, browser-based tool generates basic sitemaps without requiring a download. It’s ideal for small websites and beginners.
- TechnicalSEO sitemap generator (free)
TechnicalSEO is a straightforward tool that allows you to paste a list of URLs or crawl a website and create an XML sitemap. It’s perfect for developers or those needing quick results.
Generating sitemaps manually
Creating a sitemap manually involves writing XML code that tells search engines about your website’s pages and their structure. While it requires some basic knowledge of XML, the process is straightforward if you follow these steps.
Step-by-step guide to writing XML code for sitemaps
Step 1: Open a plain text editor
Use a simple text editor like ‘TextEdit’ for Mac or ‘Notepad’ for Windows. Avoid word processors like Microsoft Word, as they add formatting that can break the XML code.
Step 2: Start with the XML declaration
Begin the file with the following XML declaration to define the file format and encoding:
<?xml version="1.0" encoding="UTF-8"?>
Step 3: Add the <urlset> tag
The <urlset> tag defines the structure of the sitemap. Use this required namespace attribute to ensure compatibility with search engines:
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
Step 4: Add individual URLs
For each page you want to include, add a <url> block with the following elements:
- <loc>. This is the page’s URL (e.g., https://example.com/about).
- <lastmod>. This indicates the date the page was last modified. Write it in YYYY-MM-DD format).
- <changefreq>. This element shows how often the page changes (e.g., daily, weekly).
- <priority>. This specifies the page’s relative importance (from 0.0 as the lowest to 1.0 as the highest).
Example of a full <url> block:
<url>
<loc>https://www.yourwebsite.com/</loc>
<lastmod>2024-10-28</lastmod>
<changefreq>monthly</changefreq>
<priority>1.0</priority>
</url>
Step 5: Repeat for other pages
Add more <url> blocks for each page you want to include in the sitemap.
Step 6: Close the <urlset> tag
Once all URLs are added, close the <urlset> tag with </urlset>.
Your XML code should look like this once you bring all elements together:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.yourwebsite.com/</loc>
<lastmod>2024-10-28</lastmod>
<changefreq>monthly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://www.yourwebsite.com/contact/</loc>
<lastmod>2024-10-25</lastmod>
<changefreq>yearly</changefreq>
<priority>0.5</priority>
</url>
</urlset>
Step 7: Save the file
Save the file on your computer with the name ‘sitemap.xml.’ Make sure it’s saved in plain text format.
Step 8: Validate the sitemap
Use an online XML validator to check for errors in your sitemap file.
How do you submit your sitemap to Google Search Console?
Step 1: Navigate to the ‘Sitemaps’ tool
In the left-hand menu of Search Console, find the Sitemaps tool. Then, click on Sitemaps under the Indexing section.
This will take you to the sitemap submission page where you can manage all submitted sitemaps for your site.
Step 2: Input your sitemap URL
Type your sitemap URL (e.g., https://yourwebsite.com/sitemap.xml) in the Add a new sitemap field.
Ensure the sitemap is uploaded to your website’s root directory and is accessible via this URL.
Step 3: Submit the sitemap
Click Submit. Once submitted, Google will start processing the sitemap. During this step, Google will identify the pages to crawl and index.
After you’ve submitted your sitemap, its status will appear in the Sitemaps section. Initially, it may show as ‘Pending.’
Check back after a few hours or days to see if the sitemap has been successfully processed. The status will update to ‘Success’ if Google has accepted and processed the sitemap.
Sitemap best practices
A well-structured and properly maintained sitemap can improve your website’s visibility and indexing. Follow some of these best practices to ensure your sitemap is effective and error-free.
Keep your sitemap updated as your site grows
Always ensure your sitemap reflects the current structure of your website. Whenever you add, remove, or update pages, ensure your sitemap is updated to include these changes. This is especially important for dynamic websites like blogs or eCommerce platforms. Use automated tools or plugins to update your sitemap automatically.
Use a sitemap index for larger websites
For websites with thousands of pages, a single sitemap can become too large or exceed limits. In these cases, create multiple smaller sitemaps and connect them with a sitemap index file.
Ensure accessibility and optimal size
Ensure your sitemap is publicly available at a standard URL, such as https://yourwebsite.com/sitemap.xml.
Additionally, a sitemap should not exceed 50MB uncompressed. If it does, break it into smaller sitemaps, as mentioned earlier. Lastly, don’t include unnecessary URLs, as this can slow down crawling and reduce efficiency.
Test sitemaps for errors regularly
Use tools like Google Search Console to test your sitemap for errors. Sitemap tools generally help you identify and fix issues, such as:
- Invalid URLs
- Unsupported formats
- Missing pages
Set a schedule to review your sitemap routinely to ensure it’s functioning properly and aligned with your website’s structure. If any errors are found, update your sitemap and resubmit it to search engines.
Common sitemap errors and troubleshooting tips
Incorrect canonical tags
Missing canonical or incorrect tags can lead to search engines indexing the wrong URLs, affecting your site’s SEO.
How to fix it:
- Check all canonical tags in your sitemap using tools like Ahrefs. Ensure the canonical URL points to the correct version of the page.
- If the canonical tag points to a different or irrelevant URL, update the tag in your page’s HTML or Content Management System (CMS) settings.
- Ensure only canonical URLs are listed in the sitemap to prevent conflicting signals to search engines.
Prevention tip: When adding new pages, double-check that canonical tags are correctly configured to avoid future issues.
Broken links
Broken links (404 errors) in your sitemap waste search engines’ crawling resources and negatively impact your website’s SEO performance.
How to fix it:
- Use a dedicated broken link checker to identify URLs returning a 404 error.
- Replace broken links with working ones if the content has moved. Remove links of non-existing pages from your sitemap.
- Set up 301 redirects for broken URLs that have been permanently moved to a new location.
Prevention Tip: Regularly test your sitemap for broken links, especially after making significant changes to your website structure or content.
URLs blocked by the robots.txt file
When your sitemap contains URLs blocked by your robots.txt file, you miss indexing opportunities for your priority URLs.
How to fix it:
- Change the ‘Disallow’ rule to ‘Allow’ for the URLs you want search engines to crawl.
- Update your robots.txt file manually or by using WordPress plugins.
Take charge of your website’s searchability
By creating and submitting a sitemap, you make it easier for your site to show up in search results.
No matter which method you use—plugins, online tools, or doing it manually—the most important thing is to keep your sitemap updated and free of errors. Regularly check your sitemap in Google Search Console to help you spot issues early and maintain a smooth indexing process.
Now that you have the knowledge and tools to optimize your sitemap, it’s time to take action! Implement these steps today, and watch your website climb the search rankings with improved SEO and better discoverability.
If you’re looking to improve your site’s visibility further, your next best read might be our article on SEO basics for beginners.