FreeSEOTools.io
In This Article
technical-seo6 min read

How to Build an XML Sitemap Without a Plugin

An XML sitemap is a file that lists the URLs for a website, helping search engines like Google and Bing more intelligently crawl your site. Think of it as a detailed roadmap for search engine bots, gu…

F
FreeSEOTools Team
SEO Research
create xml sitemap freetechnical-seohttp-header-checker

What is an XML Sitemap and Why Do You Need One?

An XML sitemap is a file that lists the URLs for a website, helping search engines like Google and Bing more intelligently crawl your site. Think of it as a detailed roadmap for search engine bots, guiding them to all the important pages you want them to discover and index. While a properly structured website with internal linking can often lead search engines to most content, an XML sitemap provides an explicit, machine-readable declaration of your site's architecture.

For search engine optimization (SEO), XML sitemaps offer several crucial benefits:

  • Improved Crawling: Especially useful for large websites with many pages, new sites with few backlinks, or sites with "orphaned" pages (pages not linked to internally). Sitemaps ensure search engines don't miss any valuable content.
  • Faster Indexing: When search engines find new or updated URLs in your sitemap, they can process them more quickly, leading to faster indexing and visibility in search results.
  • Prioritization: While Google has stated that `` and `` tags are now mostly hints, the very act of including a URL in your sitemap indicates its importance to you.
  • Multimedia Support: Sitemaps aren't just for web pages. They can also include information about images, video, and news articles, helping these content types get discovered and ranked.
  • Error Detection: By monitoring sitemap reports in Google Search Console, you can identify crawl errors or issues that might prevent your pages from being indexed.

It's important to distinguish an XML sitemap from an HTML sitemap. An HTML sitemap is typically a human-readable page on your site, designed to help visitors navigate. An XML sitemap, however, is designed purely for search engine bots, providing structured data about your URLs in a format they can easily process. Both have their place, but for search engine discovery, the XML sitemap is paramount.

The Core Components of an XML Sitemap

An XML sitemap follows a specific, standardized structure. Understanding these core components is essential whether you're building one manually or using a generator. The basic structure revolves around a few key tags that encapsulate your URLs and their associated metadata.

The Root Element: <urlset>

Every XML sitemap begins and ends with the `` tag. This is the parent element that encloses all the URLs within your sitemap. It also defines the XML schema (namespace) that the sitemap adheres to, which tells search engines how to interpret the file. You'll typically see it defined like this:

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <!-- URLs go here -->
</urlset>

Individual URL Entry: <url>

Within the `` tag, each individual web page or resource on your site that you want search engines to crawl is enclosed within a `` tag. This acts as a container for all the specific information related to that particular URL.

The Location Tag: <loc>

The `` tag is the only mandatory tag within each `` entry. It specifies the absolute URL of the page. It must be a fully qualified URL (e.g., `https://www.example.com/page-name/`), not a relative one. Make sure these URLs are canonical and accessible; including broken or redirected URLs can signal poor quality to search engines.

Optional Metadata Tags

While `` is the only required tag, several optional tags can provide more context to search engines. It's worth noting that Google has indicated these tags are now largely treated as hints and are not strong directives, but they can still be useful:

  • <lastmod>: This tag indicates the last modification date of the file. It helps search engines understand how frequently your content is updated, potentially prompting them to re-crawl more often. The format must be W3C Datetime format (YYYY-MM-DD, or YYYY-MM-DDThh:mm:ssTZD).
  • <changefreq>: This tag suggests how frequently the page is likely to change. Values can include `always`, `hourly`, `daily`, `weekly`, `monthly`, `yearly`, and `never`. For instance, a blog post might be `weekly` or `monthly`, while an "About Us" page might be `yearly`.
  • <priority>: This tag assigns a priority to a URL relative to other URLs on your site. The value ranges from 0.0 to 1.0, with 1.0 being the highest priority. The default priority is 0.5. While it doesn't influence your page's ranking, it can tell search engines which pages you consider more important for crawling.

Here's a simple example of a single URL entry within a sitemap:

<url>
    <loc>https://www.freeseotools.io/</loc>
    <lastmod>2023-10-27T10:30:00+00:00</lastmod>
    <changefreq>daily</changefreq>
    <priority>1.0</priority>
</url>

Understanding these tags is the foundation for anyone looking to create xml sitemap free from plugins or complex software.

Step-by-Step: Manual XML Sitemap Creation

If you have a smaller website or prefer granular control, creating an XML sitemap manually is a viable option. It might seem daunting at first, but by following these steps, you can construct a valid sitemap without relying on any plugins or automated tools for the initial generation.

Identify Your Indexable URLs

Before you start writing XML, you need a comprehensive list of all the pages on your website that you want search engines to discover and potentially index. This is the most critical preparatory step.

  • Audit your website: Go through your site structure. Think about all your main pages, blog posts, product pages, category pages, and any other content areas.
  • Generate a list: For smaller sites, you might simply list URLs in a spreadsheet. For larger sites, you might use a free website crawler like Screaming Frog SEO Spider (the free version can crawl up to 500 URLs), or even export URLs from your analytics platform.
  • Exclude non-indexable content: Make sure to filter out pages that should not be in your sitemap. This includes:
    • Duplicate content (only include canonical versions).
    • Login pages, admin areas, user profiles.
    • Staging or test environments.
    • Pages with `noindex` tags in their HTML or `Disallow` rules in `robots.txt`.
    • URLs that redirect.
    • URLs that return 404 or 5xx errors.
  • Canonical URLs: Always use the canonical version of your URLs (e.g., `https://www.example.com` instead of `http://example.com` or `https://example.com/index.html`).

Structure Your URLs in a Text Editor

Once you have your list, open a plain text editor (like Notepad on Windows, TextEdit on Mac, or more advanced editors like VS Code or Sublime Text). Do NOT use a word processor like Microsoft Word, as it can introduce unwanted formatting.

Start by declaring the `` root element, including the namespace:

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

Then, for each URL you identified, create a `` entry with at least the mandatory `` tag. Here's how you'd add a few example URLs:

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <url>
        <loc>https://www.freeseotools.io/</loc>
    </url>
    <url>
        <loc>https://www.freeseotools.io/tools/</loc>
    </url>
    <url>
        <loc>https://www.freeseotools.io/blog/how-to-build-an-xml-sitemap-without-a-plugin/</loc>
    </url>
</urlset>

Remember, each `` tag must contain the full, absolute URL, including `https://` and the domain name.

Adding Optional Tags for Enhanced Control

F

FreeSEOTools Team

SEO Research

The FreeSEOTools.io editorial team creates practical SEO guides and GEO optimization resources to help marketers, developers, and business owners improve their search visibility.

Related Articles

Try Our Free SEO & GEO Tools

80+ free tools to implement what you just read — from GEO Readiness Score to Website Speed Test.