Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared hosting Managed WordPress Cloud hosting VPS hosting By reader location Hosting finder
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Blog Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

SEO & AI search · Guide

How to Export Sitemap From WordPress (Step by Step)

How to Export Sitemap From WordPress (Step by Step)

Short answer

WordPress has no export button for sitemaps because they are generated on the fly. Open your sitemap address, such as wp-sitemap or sitemap_index on your domain, then save each XML file from the browser or curl. For a URL list, load it into a crawler, Excel or Google Sheets and export the loc column.

Key takeaways

  • WordPress sitemaps are generated live, so exporting means saving what the URL returns.
  • Core uses /wp-sitemap.xml, while Yoast SEO and Rank Math use /sitemap_index.xml.
  • A sitemap index links to child sitemaps, and you need each child for the full URL list.
  • Excel, Google Sheets and crawlers can turn sitemap XML into a CSV of URLs.
  • You submit the sitemap URL to Google, not a downloaded file.

How do you export a sitemap from WordPress?

Open your sitemap URL in a browser, such as yoursite.com/wp-sitemap.xml or /sitemap_index.xml, then save each XML file or pull the URLs into a spreadsheet with a crawler, Excel or Google Sheets.

WordPress builds sitemaps on the fly. There is no sitemap file sitting on your server to download, and no Export sitemap button in the dashboard. Exporting means saving what the sitemap URL returns.

What you do next depends on why you need the export:

GoalBest method
Keep a copy of the XMLSave the page from the browser or use curl
Get a list of URLsCrawler, Excel or Google Sheets
Give the sitemap to Google or BingSubmit the URL, no export needed
Move to a new hostNo export needed, the new site builds its own
Audit pagesExport URLs to CSV, then compare

If you are new to sitemaps, our explainer on what an XML sitemap is covers the basics.

Where is your WordPress sitemap?

Your sitemap address depends on which plugin creates it: core WordPress uses /wp-sitemap.xml, while Yoast SEO and Rank Math use /sitemap_index.xml.

Common addresses:

Created bySitemap address
WordPress core (5.5 and later)/wp-sitemap.xml
Yoast SEO/sitemap_index.xml
Rank Math/sitemap_index.xml
All in One SEO/sitemap.xml
Other pluginsCheck the plugin's sitemap settings

WordPress added built-in sitemaps in version 5.5, as announced on the Make WordPress Core blog. SEO plugins usually turn the core sitemap off and replace it with their own.

You can also find the address in your robots.txt file. Many setups list it on a line that starts with Sitemap:.

If the address shows a 404 or a blank page, fix that before exporting. Our guide to fixing a sitemap that is not working covers the usual causes.

What is a sitemap index?

A sitemap index is a parent file that lists several child sitemaps, such as one for posts, one for pages and one for categories, and each child holds the actual URLs.

Both core WordPress and the big SEO plugins use this layout. So when you open /wp-sitemap.xml, you see links to files like wp-sitemap-posts-post-1.xml and wp-sitemap-posts-page-1.xml rather than your page URLs.

That matters for exporting. To get every URL, you need each child sitemap, not just the index.

Large sites split each type across several numbered files. Core WordPress puts up to 2,000 URLs in each file by default, which the wp_sitemaps_max_urls filter can change. The sitemap protocol itself allows up to 50,000 URLs per file.

How do you save the sitemap XML from your browser?

Open the sitemap URL, view the page source to see the raw XML, then use your browser's Save Page As option and save it with an .xml extension.

Step by step:

  1. Open your sitemap index URL
  2. Click a child sitemap, such as the posts sitemap
  3. Press Ctrl+U on Windows or Cmd+Option+U on Mac to view the source
  4. Press Ctrl+S or Cmd+S to save
  5. Name the file, for example posts-sitemap.xml
  6. Repeat for each child sitemap

Viewing the source first helps because most sitemaps load a stylesheet that turns the XML into a readable table. Saving the styled view can give you HTML instead of clean XML.

This works well for small sites. With many child files, a command-line tool or crawler is faster.

How do you download the sitemap with curl?

Run curl with the sitemap URL and an output file name, which saves the raw XML exactly as your server sends it.

From a terminal:

curl -o sitemap-index.xml https://example.com/wp-sitemap.xml
curl -o posts-1.xml https://example.com/wp-sitemap-posts-post-1.xml

Replace example.com with your domain. If your site sits behind basic authentication or a firewall that blocks scripts, the download may fail. Run it from a network your security rules allow.

This method is handy for backups or when you want to compare two copies of the sitemap over time.

How do you export sitemap URLs to Excel or CSV?

Use a crawler's list mode to load the sitemap and export the URLs, or import the XML into Excel or Google Sheets and keep only the loc column.

Three practical options:

  • Screaming Frog SEO Spider: switch to List mode, choose to download an XML sitemap, paste the sitemap index URL, then export. The free version has a URL limit, so check Screaming Frog's site for current terms.
  • Excel: use Data > Get Data > From File > From XML, select your saved XML file, and load the table. The URLs appear in the loc column.
  • Google Sheets: use IMPORTXML with the sitemap URL and an XPath that picks the loc elements.

For Google Sheets, this formula works on many sitemaps:

=IMPORTXML("https://example.com/wp-sitemap-posts-post-1.xml", "//*[local-name()='loc']")

The local-name() part gets around the sitemap namespace, which can stop simpler XPath expressions from matching.

Microsoft's Power Query documentation explains how Excel reads XML files if the import menu looks different in your version.

How do you export the sitemap from Yoast SEO or Rank Math?

Neither plugin has a download button, so open its sitemap index at /sitemap_index.xml and save or crawl the child sitemaps the same way as any other XML file.

In Yoast SEO, you can confirm the sitemap is on and find the link in the plugin's settings. Yoast's XML sitemaps help page shows where.

In Rank Math, open Rank Math SEO > Sitemap Settings. The sitemap index link appears at the top of that screen.

If the plugin sitemap returns a 404, flush permalinks by saving Settings > Permalinks once. For Yoast, see our guide to the Yoast sitemap 404.

For Rank Math, read our guide to Rank Math sitemap problems.

Do you need to export a sitemap to submit it to Google?

No, you submit the sitemap URL itself in Google Search Console, and Google fetches the live file whenever it wants, so a downloaded copy is not needed.

To submit it:

  1. Open Google Search Console for your property
  2. Go to Indexing > Sitemaps
  3. Enter the sitemap index path, such as sitemap_index.xml
  4. Click Submit

Google's sitemap guidelines explain the format and limits. Bing Webmaster Tools works the same way, with its own Sitemaps section.

If Search Console is not set up yet, start with our guide to connecting Google Search Console to WordPress.

Should you export your sitemap before migrating?

Exporting the sitemap is not needed for the migration itself, but saving a URL list before you move is a smart way to check that every page still loads afterwards.

The new site creates its sitemap automatically once WordPress and your SEO plugin are running. You do not upload the old file.

What helps is a before-and-after check:

  1. Export the old sitemap URLs to a spreadsheet
  2. Migrate the site
  3. Crawl the same URLs on the new site
  4. Look for 404s, redirects you did not expect and missing pages

This catches broken permalinks and missing content early, before visitors or search engines find them.

Can you upload a static sitemap file instead?

You can upload a static sitemap.xml to your site root, but it goes out of date as soon as you publish or delete content, so a dynamic sitemap is usually better.

A static file also takes priority over WordPress at the same path on many servers. That can hide your plugin's sitemap and confuse search engines with old URLs.

If you have an old sitemap.xml file in your root folder from a previous setup, consider removing it. Then confirm the live sitemap loads from WordPress.

What should you check after exporting?

Check that the export holds every child sitemap, that the URL count looks right, and that no noindexed, draft or redirected pages appear in the list.

Quick checks:

  • Compare the URL count with your published posts and pages
  • Look for staging or HTTP URLs that should not be there
  • Spot tag or author archives you meant to exclude
  • Make sure important pages are not missing

If the list includes pages you do not want indexed, change what the sitemap contains rather than editing the export. The sitemaps.org protocol describes what each tag means if you need to read the raw file.

Frequently asked questions

Can I download my WordPress sitemap as a file?

Yes. Open the sitemap in your browser, view the page source and save it with an xml extension, or download it with curl. Repeat this for each child sitemap, because the index file only lists other sitemaps, not your page URLs.

How do I get all URLs from my WordPress sitemap?

Load the sitemap index into a crawler in list mode, or import each child sitemap into Excel or Google Sheets. Keep the loc values, which are the page URLs, and combine the lists from every child file into one sheet.

Why does my sitemap look like a styled table instead of XML?

WordPress and most SEO plugins attach a stylesheet so people can read the sitemap in a browser. The underlying file is still XML. View the page source to see and save the raw markup.

Do I need to move my sitemap when I change hosts?

No. WordPress and your SEO plugin rebuild the sitemap on the new host automatically. Saving a URL list before the move is still useful, because you can check each URL afterwards and catch broken pages.

Is there a limit to how many URLs a sitemap can hold?

The sitemap protocol allows up to 50,000 URLs or 50 MB uncompressed per file. WordPress core splits its sitemaps into smaller pages by default, and SEO plugins also split large sitemaps into numbered files.

Sources

  1. New XML Sitemaps Functionality in WordPress 5.5 Make WordPress Core
  2. wp_sitemaps_max_urls WordPress Code Reference
  3. Build and submit a sitemap Google Search Central
  4. Sitemaps XML format sitemaps.org
  5. XML sitemaps in the Yoast SEO plugin Yoast
  6. XML connector Microsoft Learn

Is your product missing, or something out of date?

Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.

About the editors

Written and checked byWPLegible Editorial Team Independent WordPress reviews and guides

Researched from the primary sources listed above and checked against our editorial rules before publishing.