How to Create a Sitemap: Step-by-Step XML Setup Guide
Learn how to create a sitemap, generate the correct XML structure, and submit your URLs to search engines for better site indexing.
To learn how to create a sitemap, you first need to decide whether your site platform handles it automatically or if you need to generate a standalone XML file yourself. Most modern content management systems generate and update one on their own, while custom platforms, static websites, and curated URL migrations require a dedicated generator. Once your file is saved with the right syntax and canonical URLs, you upload it to your web server and submit the live link to search engines.
Which Sitemap Method Should You Pick?
Before building a file, identify what kind of sitemap you actually need. Search engines look for an XML file that lists valid, indexable URLs along with optional metadata like last modification dates. UX designers, on the other hand, often refer to a visual site architecture map created during wireframing.
If you are planning website navigation or user flows, tools like Figma let you connect boxes and tree structures visually. That helps your team plan information architecture, but search engine crawlers cannot read design canvas files. Search engines require a standard XML file following the Sitemaps protocol.
For an XML file, the right creation method depends entirely on your setup:
- Automated CMS output: Platforms like WordPress and Wix create dynamic XML feeds out of the box. You rarely need to touch code or manually update these files.
- Browser-based generator: If you run a static site, an export from an unsupported platform, or a custom migration list, a tool like the Sitemap.xml Generator on Links to Wild lets you paste URLs and get a compliant XML file in seconds.
- Spreadsheets: If you manage complex URL lists with specific modification dates, assembling URLs in Excel or Google Sheets allows you to manipulate data before exporting.
- Plain text editor: Small websites with only a dozen pages can be written directly in a code editor like VS Code or Notepad.
Method 1: Generate an XML File in Your Browser
When you have a flat list of URLs and need a clean file fast, a browser-based generator is the most direct path. This approach avoids software installations and does not require server-side script execution.
- Assemble your list of clean URLs: Export your live pages from your internal database, analytics, or crawl tool. Strip out duplicate parameters, tracking tags, and non-canonical variations.
- Paste the URLs into the generator: Open the Links to Wild Sitemap.xml Generator. The tool runs entirely in your browser, so your page lists remain private.
- Configure optional tags: Choose whether you want to assign
lastmod(last modified date),changefreq, orpriorityvalues across the URLs. - Download the file: Generate the markup and save the output locally as
sitemap.xml. - Upload to your server: Place the file in the public root folder of your site (for example,
https://example.com/sitemap.xml).
Method 2: Built-In Sitemaps in WordPress, Wix, and Shopify
Most popular platforms manage indexing files natively. Generating a second file manually on these platforms is usually unnecessary and can cause conflicting indexing signals.
WordPress
Core WordPress includes a native XML sitemap feature without requiring third-party plugins. You can view it by visiting example.com/wp-sitemap.xml.
- Check your site settings in the WordPress admin panel under Settings > Reading.
- Ensure the box labelled Search engine visibility ("Discourage search engines from indexing this site") is unchecked. If checked, WordPress disables the sitemap feed entirely.
- If you prefer finer control over excluded categories or custom post types, install an established SEO plugin such as Yoast SEO, Rank Math, or All in One SEO. These plugins take over the default core feed and generate their own index at
example.com/sitemap_index.xml.
Wix
Wix writes and updates an XML index automatically whenever you publish changes. You do not need to create one manually.
- Open your browser and visit
example.com/sitemap.xmlto inspect your live file. - To remove a page from this auto-generated file, open your Wix Editor, go to the page settings, open the SEO (Google) tab, and switch off the toggle that allows search engines to show the page in search results.
Shopify
Similar to Wix, Shopify automatically generates a primary index file at example.com/sitemap.xml. It groups products, collections, blog posts, and marketing pages into sub-sitemaps. Shopify updates these files automatically as you add products or blog articles.
Method 3: Build a Sitemap in Excel or Google Sheets
If you are planning a staging environment, testing redirects, or organizing URLs manually, you can build your XML structure in a spreadsheet using simple string formulas.
- List your URLs in Column A: Add one full, absolute URL per row, starting at cell
A2(for example,https://example.com/page-1). - List your modification dates in Column B: Add the last updated date in W3C format (YYYY-MM-DD), such as
2026-03-15. - Write an XML formula in Column C: In cell
C2, enter a concatenation formula:
=CONCATENATE("<url><loc>", A2, "</loc><lastmod>", B2, "</lastmod></url>") - Drag the formula down: Copy cell
C2across all rows containing your URLs. - Assemble the file in a text editor: Copy the output cells from Column C. Open a plain text editor, paste the XML header block at the top, paste your copied rows into the middle, and close the file with
</urlset>. - Save with the right extension: Save your document as
sitemap.xmlwith UTF-8 encoding.
Method 4: Write a Sitemap Manually in a Text Editor
For a portfolio, single-page site, or lightweight company profile with fewer than 20 pages, writing the file manually takes only a few minutes. All valid sitemaps must adhere to the standard schema published via official guidelines on Google Developers.
- Open a plain text editor: Use a tool like Notepad, BBEdit, or VS Code. Do not use word processors like Microsoft Word, as they add hidden styling characters.
- Add the XML declaration and namespace: Paste the opening tags at the top of the file:
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> - Add a block for every URL: Each page requires its own
<url>block containing the absolute URL in the<loc>tag:<url> <loc>https://example.com/</loc> <lastmod>2026-02-10</lastmod> </url> <url> <loc>https://example.com/about</loc> <lastmod>2026-01-18</lastmod> </url> - Close the root tag: End the document with
</urlset>on its own line. - Save the document: Save the file as
sitemap.xmland upload it to your web server root.
How to Submit a Sitemap to Google Search Console
Search engines can locate your sitemap through discovery, but submitting your link directly into Google Search Console speeds up processing and unlocks coverage diagnostics.
- Log in to Google Search Console: Select your verified property from the property dropdown in the top left corner.
- Navigate to the Sitemaps tab: In the left navigation menu under the Indexing section, click on Sitemaps.
- Enter the file path: In the Add a new sitemap field, enter the relative URL where your file lives (for instance,
sitemap.xmlorsitemap_index.xml). - Click Submit: Search Console will ping the URL and register the sitemap in your dashboard. The status usually reports "Success" once parsed.
- Reference the file in your robots.txt: Add the absolute URL to your robots file so other crawlers find it naturally. Learn how to format this directive properly in our guide on how to create a robots.txt file for your website.
Common Mistakes and How to Check Your Sitemaps
Creating the file is simple, but small syntax errors or conflicting directives can cause search engines to ignore your entries entirely.
| Issue | Why It Breaks Crawling | How to Fix It |
|---|---|---|
| Relative URLs | Search engines cannot parse bare paths like /about inside sitemaps. |
Always supply absolute addresses: https://example.com/about. |
| Blocked or Redirected URLs | Submitting 301, 404, or noindex pages wastes crawl budget. |
Include only 200 OK, indexable canonical URLs. Verify your canonical signals with our Canonical Tag Checker. |
| Fictitious lastmod Timestamps | Updating every date to today's date causes crawlers to distrust your timestamps. | Set lastmod only when page body copy or structure meaningfully changes. |
| Files Exceeding Size Limits | A single uncompressed XML sitemap file cannot exceed 50MB or 50,000 URLs. | Split large files into smaller components and group them under a parent sitemap index file. |
Before leaving your file live on production, verify its formatting. You can paste your finished code into the XML Sitemap Validator to detect syntax errors, invalid date structures, or relative URLs before Search Console flags them.
Frequently Asked Questions
I submitted a sitemap and my pages still are not indexed. What went wrong?
Probably nothing. A sitemap is a discovery aid, not an indexing request. It tells Google the URL exists, and Google still decides independently whether the page is worth keeping. Pages that sit unindexed after discovery almost always have the same problem: nothing links to them and there is nothing on them that another page does not already say.
Do I need a sitemap for a small site?
Under a few hundred well-linked pages it adds very little to discovery. Submit one anyway, because Search Console reports coverage per sitemap. That turns "some pages are not indexed" into a list you can act on, which is worth the five minutes on its own.
What date should lastmod be?
The date the content meaningfully changed. Not the build timestamp, not the date you swapped a footer link. Google uses lastmod when it is consistently honest and ignores the field entirely once it is not. A sitemap where every URL changed at 03:00 this morning is the fastest way to teach search crawlers to ignore yours.
Do I have to resubmit the sitemap after I update it?
No. Google refetches submitted sitemaps on its own schedule. The old ping endpoint was retired in 2023, so any script you inherited that calls it is hitting a deprecated URL and doing nothing.
How do I create a sitemap in Figma?
In Figma, you build visual tree diagrams using shapes, text frames, and connector lines (often using FigJam). This is an information architecture diagram for designers and developers, not an XML file for search engines. To convert a Figma architecture plan into an indexing sitemap, list the final planned URLs and feed them into an XML generator.