A sitemap is a file that lists every page on your website you want search engines to find. Submitting it to Google doesn't guarantee indexing, but it removes one of the biggest barriers: Google not knowing your pages exist.
Here's how to generate a sitemap, submit it to Google Search Console, and fix the most common problems.
Why Sitemaps Still Matter
Google discovers pages by following links. If every page on your site is reachable through internal links, Google will eventually find them. But "eventually" can mean weeks or months, and some pages get missed entirely.
A sitemap solves this by giving Google a complete map of your site upfront. It's especially valuable when:
- Your site is new and has few inbound links
- You have hundreds or thousands of pages
- Your pages aren't well-connected through internal linking
- You publish content frequently and want it indexed quickly
- You've restructured your site and changed URLs
Google's own documentation recommends sitemaps for all but the smallest sites. There's no downside to having one.
What a Sitemap Looks Like
A sitemap is an XML file, usually located at yourdomain.com/sitemap.xml. Here's a simplified version:
Each <url> entry contains a <loc> tag with the full URL, and optionally a <lastmod> date showing when the page was last updated. The <changefreq> and <priority> tags are technically part of the spec, but Google has confirmed it ignores both. Don't waste time fine-tuning them.
How to Generate Your Sitemap
WordPress
WordPress has included a built-in sitemap since version 5.5. It's available at yourdomain.com/wp-sitemap.xml automatically. However, it's fairly basic. For more control, use one of these plugins:
- Yoast SEO generates a sitemap at
/sitemap_index.xmland lets you exclude specific post types, taxonomies, or individual pages - Rank Math offers similar sitemap control with a slightly different interface
- Google XML Sitemaps is a lightweight option if you only need sitemap functionality
Static Sites and Custom Builds
If you're running a custom site, you have a few options:
- Screaming Frog (free for up to 500 URLs) crawls your site and generates a sitemap file you can upload
- xml-sitemaps.com is an online generator for smaller sites
- Build tools like
vite-plugin-sitemapornext-sitemapgenerate sitemaps during your build process
E-commerce Sites
Shopify, WooCommerce, and Magento all generate sitemaps automatically. Shopify puts it at /sitemap.xml. WooCommerce uses your SEO plugin's sitemap. Check that product pages, category pages, and images are all included.
Submitting to Google Search Console
Google Search Console is free. If you haven't set it up yet, go to search.google.com/search-console and verify your domain ownership. The easiest method is adding a DNS TXT record through your domain registrar.
Once verified:
- Click "Sitemaps" in the left sidebar
- Enter the URL of your sitemap (usually just
sitemap.xml) - Click "Submit"
Google will show the status as "Success" once it fetches and reads the file. This usually takes a few minutes, but occasionally takes a day or two.
You only need to submit your sitemap once. Google will re-check it periodically on its own. If you want to speed things up after a big content update, you can click the sitemap URL in Search Console and choose "Resubmit."
Adding Your Sitemap to robots.txt
As a belt-and-suspenders approach, add a reference to your sitemap in your robots.txt file. This lives at your domain root and looks like this:
Sitemap: https://yourdomain.com/sitemap.xml
This tells every search engine (not just Google) where to find your sitemap. Bing, Yandex, and other crawlers check robots.txt and will discover it automatically.
Common Sitemap Errors and Fixes
"Couldn't Fetch" Error
This means Google tried to access your sitemap URL and got an error. Common causes:
- The sitemap URL is wrong (check for typos)
- Your sitemap is returning a 404 or 500 error (visit the URL in your browser to verify)
- Your robots.txt is blocking the sitemap (check for overly broad
Disallowrules) - Your server is too slow to respond within Google's timeout window
"Has Errors" Status
Click on the sitemap in Search Console to see specific errors. The most common ones:
- Invalid URL format. Every URL must include the full protocol (
https://) and domain. Relative paths don't work. - URLs blocked by robots.txt. Don't include URLs in your sitemap that your robots.txt blocks. Google flags this as a contradiction.
- HTTP/HTTPS mismatch. If your site uses HTTPS, every URL in the sitemap must use HTTPS too.
- Too large. Sitemaps are limited to 50,000 URLs and 50MB. For larger sites, split into multiple sitemaps and use a sitemap index file.
"Discovered, Currently Not Indexed"
This means Google found the page through your sitemap but chose not to index it. This isn't a sitemap problem. It's usually a content quality issue. Pages that are thin, duplicate, or low-value often get this status. Improve the content and request re-indexing.
Keeping Your Sitemap Healthy
A few maintenance habits go a long way:
- Remove deleted pages. If you delete a page, make sure it drops out of your sitemap. CMS plugins usually handle this, but verify after major deletions.
- Don't include noindex pages. Pages with a
noindexmeta tag should not appear in your sitemap. Google considers this contradictory. - Keep lastmod dates accurate. Only update the
lastmoddate when you make meaningful changes. Changing it daily when nothing changed trains Google to ignore it. - Check Search Console monthly. Look for new errors, coverage drops, or pages stuck in "Discovered, Currently Not Indexed."
Speed Up the Process
A fast, reliable server helps Google crawl and index your site more efficiently. If your server is slow to respond, Googlebot visits less often and crawls fewer pages per session.
SpectraHost hosting plans run on NVMe storage with LiteSpeed web server, delivering the fast response times that keep Googlebot coming back frequently.
