Skip to content
BeoHosting
BeoHosting
Technical

How to Create a Sitemap for Your Site

BeoHosting Team··8 min read read
How to Create a Sitemap for Your Site

What is an XML sitemap?

An XML sitemap is a file that contains a list of all important pages on your site. It helps search engines like Google, Bing, and Yandex find and index your content faster and more efficiently. Think of the sitemap as a map of your site you hand to search engines - instead of them wandering around looking for pages, you show them exactly where everything is.

The sitemap file uses XML format (eXtensible Markup Language) and is usually located at yoursite.com/sitemap.xml. Every entry in the sitemap contains the page URL, the date of the last change, the frequency of changes, and the page's priority relative to others.

Why is a sitemap important for SEO?

Although search engines can find your pages by following links, a sitemap significantly simplifies their job. This is especially important for:

  • New sites: When you do not have many inbound links, search engines have trouble discovering your pages without a sitemap.
  • Large sites: Sites with more than 500 pages benefit because the sitemap ensures no page is skipped. For large sites we recommend business hosting with sufficient resources.
  • Sites with poor internal linking: If your pages are not well linked, the sitemap fills those gaps.
  • Sites with rich media: Images, videos, and other media are indexed better when listed in the sitemap.

XML sitemap structure

A basic XML sitemap looks like this: it starts with an XML declaration and a urlset element containing a namespace. Inside, every page is represented by a url element with the following data:

  • loc: The full URL of the page (required field).
  • lastmod: Date of last change in ISO 8601 format (e.g. 2026-04-01).
  • changefreq: How often the page changes - daily, weekly, monthly, yearly.
  • priority: Value from 0.0 to 1.0 indicating relative page priority.

The maximum size of a single sitemap file is 50,000 URLs or 50MB. If you need more, use a sitemap index file that links several sitemaps.

Tools for creating sitemaps

For WordPress sites

The simplest way to create a sitemap for a WordPress site is using an SEO plugin:

  • Yoast SEO: Automatically generates a sitemap at /sitemap_index.xml. You can control which content types are included.
  • Rank Math: Also creates a sitemap automatically with advanced filtering options.
  • Google XML Sitemaps: A standalone plugin focused exclusively on sitemap creation with detailed control.

For static sites and custom CMS

If you do not use WordPress, you can use online generators or CLI tools:

  • XML-Sitemaps.com: A free online generator that crawls your site and creates a sitemap. Limited to 500 pages in the free version.
  • Screaming Frog: A desktop application that crawls the site and exports a sitemap. The free version supports up to 500 URLs.
  • sitemap-generator-cli: A Node.js tool you can run from the terminal for automated sitemap generation.

Manual creation

For small sites (up to 20-30 pages), you can manually write an XML sitemap in any text editor. This gives you full control over the content but requires manual updates on every change to the site.

How to submit a sitemap to search engines

Google Search Console

Sign in to Google Search Console (see our SEO optimization guide), select your site, go to Sitemaps in the left menu, and enter the URL of your sitemap (typically sitemap.xml). Click Submit and Google will start processing your sitemap. You can monitor status on the same page.

Bing Webmaster Tools

Similar to Google, sign in to Bing Webmaster Tools, go to the Sitemaps section, and submit your sitemap URL. Bing also supports automatic sitemap discovery via the robots.txt file.

Via robots.txt

Add the line Sitemap: https://yoursite.com/sitemap.xml to your robots.txt file. All search engines that respect robots.txt will automatically find your sitemap without manual submission.

Sitemap best practices

  • Include only canonical URLs: Do not include pages with a noindex tag, duplicates, or redirected URLs.
  • Update lastmod only when content really changes: Google ignores lastmod if it is inaccurate or changes without actual page edits.
  • Use absolute URLs: Always specify the full path with protocol (https://yoursite.com/page).
  • Split large sitemaps: If you have more than 10,000 URLs, split the sitemap into several smaller files and use a sitemap index.
  • Automate generation: Set a cron job or use a CMS plugin that automatically regenerates the sitemap after each change.
  • Check for errors: Regularly review Google Search Console for sitemap errors - invalid URLs, 404 pages, and similar.

Common sitemap mistakes

One of the most common mistakes is including pages that return 404 errors or pages blocked in robots.txt. Many people also forget to update the sitemap when adding new pages or removing old ones. Incorrect lastmod dates can cause Google to crawl your site less, as it loses trust in the accuracy of information.

Conclusion

An XML sitemap is a simple but powerful tool that helps search engines index your site efficiently. Whether you use a WordPress plugin, an online generator, or create it manually, the most important thing is to regularly update it and submit it to search engines. Once your site exceeds 50 pages, the sitemap stops being optional. Use our DNS checker to verify your site is configured properly - the sitemap becomes essential for good SEO.

BeoHosting Team

10+ years of experience — Web hosting and infrastructure specialists

  • Web Hosting
  • WordPress Hosting
  • VPS
  • Dedicated Serveri
  • Domeni
  • SSL
  • cPanel
  • LiteSpeed
  • Linux administracija
  • DNS

Last updated: