A WordPress site grows quietly. You publish posts, add pages, and reorganise menus, and the site a search engine sees is whatever it can piece together by following links. A new post that nothing links to yet, or an older page buried several clicks deep, can wait a long time to be discovered that way. An XML sitemap closes the gap: it is a single file that lists the pages on your site and hands the list to search engines directly.
Most advice about WordPress sitemaps turns into a tour of plugins. This guide takes the shorter route. Whatever your WordPress setup looks like, the sitemap itself is always the same object: a correctly formatted file built from your site's URL list. Ovatly's free XML Sitemap Generator does that formatting work. You bring the list of addresses, it returns sitemap.xml.
Contents
- Quick answer
- What the sitemap file actually is
- Where the URL list comes from on a WordPress site
- How to create the sitemap, step by step
- Worked example: the first two pages of a site
- Where the finished file goes
- Limitations and honest expectations
- Common mistakes
- FAQs
- Conclusion
Quick answer
Collect the full addresses of the WordPress posts and pages you want search engines to find, one per line, each starting with https://. Paste the list into the XML Sitemap Generator, optionally choose a change frequency, a priority and a last-modified date to apply across the list, and check the skipped-lines report for anything rejected. Then copy or download the generated sitemap.xml, upload it to the root of your domain, and reference it in robots.txt with a Sitemap line and in your search console accounts.
What the sitemap file actually is
A sitemap is an XML file with a simple structure. The file is a <urlset> containing one <url> entry per page. Each entry carries the page's address in a <loc> element, and can optionally add a <changefreq> value, a <priority> value and a last-modified date. That is the whole format. The difficulty is never the idea; it is producing the file without typos, broken markup or invalid entries, which is exactly the part the generator takes over.
Two properties of the format matter for a WordPress site. First, every entry must be a complete absolute URL, protocol included. A line reading example.com/about is not an entry; it is a mistake the generator will report and skip. Second, the values for change frequency, priority and last-modified are applied across the whole list in this tool, not set page by page. For most small and medium WordPress sites that is a fair trade: the file stays simple, and as the limitations section explains, search engines treat those optional values lightly anyway.
Where the URL list comes from on a WordPress site
The generator does not crawl your site, and it does not need to. The list it works from is one you assemble from the site itself: the home page, the static pages (About, Contact, Services and the like), and the published posts, each as the full address a visitor would see in the browser.
Assembling the list is also the moment to apply judgement. A sitemap is a list of the canonical, indexable pages you want search engines to find. That means leaving out redirects, pages marked noindex, and duplicate versions of the same content. WordPress sites accumulate such addresses over time: an old slug that now forwards elsewhere, a thank-you page after a form, a print or preview version of a post. None of them belong in the file. The sitemap is a discovery hint, not an inventory of everything the site can serve, and a clean list is worth more than a complete one.
Copy each address exactly as it appears, with https:// at the front. Special characters are not your problem: the generator XML-escapes them automatically, so an ampersand in a URL becomes the escaped form the format requires.
How to create the sitemap, step by step
- Assemble your URL list, one full URL per line, including https://.
- Open the XML Sitemap Generator and paste the list in.
- Optionally choose a change frequency, a priority and a last-modified date to apply to every URL in the list.
- Check the skipped-lines report if any URL was rejected, fix the line (usually a missing protocol) and rebuild if needed.
- Copy or download the generated sitemap.xml and upload it to your site root.
Worked example: the first two pages of a site
Start with the smallest useful list, the one the tool's own documentation uses: two lines, https://example.com/ and https://example.com/about, with change frequency "weekly" and priority "0.8" selected. The output is a <urlset> where each page appears as a <url> block holding its <loc> plus the chosen <changefreq> and <priority> values.
The same example shows the failure mode worth learning. If the second line is pasted as example.com/about, without the protocol, that line is reported and skipped rather than written into the file as a broken entry. The sitemap you download contains only the valid home page entry, and the report tells you exactly which line to fix. On a real WordPress list of forty or sixty lines, that report is the difference between a file that is silently wrong and one you know is right.
Where the finished file goes
Upload sitemap.xml to the root of the domain it describes, so it sits at an address like https://example.com/sitemap.xml. Then point search engines at it in two places: add a Sitemap line naming the file in your robots.txt, and submit or reference it in your search console accounts. Both steps are how the file gets noticed; a sitemap uploaded but never referenced can still be found, but there is no reason to rely on that.
Limitations and honest expectations
A sitemap helps discovery and crawling of new or deep pages. It does not improve rankings, and it is not a guarantee of indexing; both depend on the pages themselves. Keep that framing and the file does its one job well.
The optional values deserve the same honesty. Google largely ignores priority and changefreq values, and uses lastmod only when it is consistently accurate, so treat all three as tidy documentation rather than levers. A wrong lastmod copied across the whole list is worse than none.
Size is the last limit. The sitemap protocol allows up to 50,000 URLs and 50 MB uncompressed per file, and this tool enforces a practical cap of 2,000 URLs per build and tells you when it trims the list. A typical WordPress blog or business site sits far below that. If your site ever outgrows it, the answer is several files joined by a sitemap index, which the sibling guide below covers.
Common mistakes
- Pasting bare domains or relative paths. Lines without http:// or https:// are skipped. Work from the skipped-lines report, not from memory.
- Listing everything the site can serve. Redirects, noindexed pages and duplicates dilute the file. List canonical, indexable pages only.
- Treating inclusion as a promise. A page in the sitemap can still go unindexed if the page itself does not earn it.
- Uploading the file somewhere other than the root. The file belongs at the root of the domain it describes.
- Forgetting to reference it. Add the Sitemap line to robots.txt and submit it in your search console accounts.
- Inventing lastmod dates. A last-modified date is only useful when it is accurate; a guessed date applied to every URL teaches search engines to ignore the field.
FAQs
Where do I put the sitemap file?
At the root of the domain it describes, for example https://example.com/sitemap.xml, and reference it in robots.txt with a Sitemap line and in your search console accounts.
Should every page be in the sitemap? List the canonical, indexable pages you want search engines to find. Leave out redirects, noindexed pages and duplicates; the sitemap is a discovery hint, not a guarantee of indexing.
Why was one of my URLs skipped? Entries must be complete absolute URLs starting with http:// or https://. Relative paths and bare domains without a protocol are reported and excluded so the file stays valid.
Does a sitemap improve rankings? No, it helps discovery and crawling of new or deep pages. Rankings depend on the pages themselves.
What happens to special characters in my URLs? They are XML-escaped automatically by the generator, so an ampersand in a URL becomes the escaped form the XML format requires and the file stays valid.
Conclusion
A WordPress sitemap is not a plugin decision; it is one correct file built from your site's own addresses. Assemble the list of canonical, indexable posts and pages, let the XML Sitemap Generator handle the formatting and the invalid-line checks, upload the result to your domain root, and reference it in robots.txt and your search console accounts. When the site grows into thousands of URLs, the same list-first method scales into several files joined by an index, as How to Build a Sitemap Index explains. More guides like this one live in the SEO Tools guide archive.