XML Sitemap Generator
Generate XML sitemaps from a list of URLs with priority and change frequency settings.
Enter one URL per line. HTTP/HTTPS required.
About this tool
An XML sitemap is a structured file that tells search engines like Google about all the pages on your website, their importance, and how often they change. The XML Sitemap Generator tool lets you quickly create a properly formatted sitemap from a simple list of URLs without needing to write XML manually or install server software. This is essential for helping search engines discover and index your content more efficiently, especially on larger websites or those with complex navigation.
To use the tool, simply paste your URLs into the input field—one per line—and optionally set the priority (0.0 to 1.0) and change frequency (never, yearly, monthly, weekly, daily, hourly) for each URL. The tool automatically generates a valid XML sitemap that complies with the sitemap protocol standard, and you can download it as an XML file or copy the code directly. This sitemap can then be submitted to Google Search Console, Bing Webmaster Tools, or placed in your website's root directory.
The XML Sitemap Generator is particularly useful for e-commerce sites, blogs with hundreds of pages, and content creators who want better search visibility. If you're managing a large website or migrating content between platforms, generating an accurate sitemap saves time and ensures search engines prioritize your most important pages. For smaller sites, you may use automated sitemap generators built into your CMS, but this tool gives you full control over priority and change frequency settings.
Frequently Asked Questions
Code Implementation
from xml.dom.minidom import parseString
from xml.etree.ElementTree import Element, SubElement, tostring
from datetime import date
def generate_sitemap(urls):
urlset = Element("urlset")
urlset.set("xmlns", "http://www.sitemaps.org/schemas/sitemap/0.9")
for entry in urls:
url_el = SubElement(urlset, "url")
SubElement(url_el, "loc").text = entry["url"]
SubElement(url_el, "lastmod").text = entry.get("lastmod", date.today().isoformat())
SubElement(url_el, "changefreq").text = entry.get("changefreq", "weekly")
SubElement(url_el, "priority").text = str(entry.get("priority", 0.8))
xml_str = tostring(urlset, encoding="unicode")
declaration = '<?xml version="1.0" encoding="UTF-8"?>\n'
return declaration + parseString(xml_str).toprettyxml(indent=" ").split("\n", 1)[1]
urls = [
{"url": "https://example.com/", "priority": 1.0, "changefreq": "daily"},
{"url": "https://example.com/about", "priority": 0.7},
{"url": "https://example.com/contact", "priority": 0.5},
]
print(generate_sitemap(urls))Comments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.