How to Create and Submit an XML Sitemap to Search Engines
An XML sitemap is a simple file that lists the pages on your website, so search engines can find and index them all — even ones that are not well linked internally. It will not magically boost rankings, but it makes sure Google knows your pages exist, which is the essential first step to appearing in search at all.
How to create a sitemap
You rarely build one by hand. The easy routes:
- WordPress — an SEO plugin (such as Yoast or Rank Math) generates and updates a sitemap automatically, usually at
yourdomain.com/sitemap.xmlor/sitemap_index.xml. - Other sites — an online sitemap generator can crawl your site and produce an
.xmlfile you upload to your document root.
Step 1: Find your sitemap URL
Visit yourdomain.com/sitemap.xml in your browser. If you see a list of URLs (or an index linking to more), you have a working sitemap. Note the exact address.
Step 2: Submit it to Google
- Open Google Search Console (see verifying your domain if you have not set it up).
- Go to Sitemaps in the left menu.
- Enter your sitemap path (e.g.
sitemap.xml) and click Submit.
Google will fetch it and begin discovering your pages. You can submit the same file to Bing Webmaster Tools too.
Step 3: Point robots.txt at it
Adding a line to your robots.txt helps every crawler find the sitemap. See creating a robots.txt file for the exact line to add.
Frequently asked questions
Do I need a sitemap for a small site?
Even small sites benefit, and it costs nothing. It is most valuable for new sites (which have few inbound links) and large sites (with many pages), but there is no downside to having one.
How often should I resubmit it?
You do not need to resubmit constantly. A plugin-generated sitemap updates itself, and Google re-checks it periodically. Resubmit manually only after a major structural change.
My pages are in the sitemap but not in Google.
A sitemap invites indexing; it does not guarantee it. Make sure pages are not blocked by robots.txt or a noindex tag, and give Google time. Improving site speed and quality helps too.
Was this article helpful?