Overview
Every commercebuild webstore automatically generates XML sitemaps that contain all published product URLs. You can use these sitemaps to quickly export a complete list of product page URLs into a plain text file, useful for audits, redirects, migrations, or SEO checks.
There are two sitemap sources you can use depending on your needs:
| Sitemap | URL Pattern | Best For |
|---|---|---|
| Google Product Sitemap | https://www.yourstore.com/sitemap_google_products.xml |
Product URLs with Google Shopping data |
| Products Sitemap | https://www.yourstore.com/sitemap_products.xml |
Clean list of all product page URLs |
How It Works
Prerequisites
-
Terminal access (macOS Terminal, Linux shell, or Windows WSL)
-
curlandsed(pre-installed on macOS/Linux) -
Replace
www.yourstore.comin all examples below with your actual webstore URL
Option 1: Download and Extract from Google Product Sitemap
This method downloads the sitemap file first, then parses it locally.
Step 1: Download the sitemap:
Visit this URL in your browser (replacing the domain with yours):
https://www.yourstore.com/sitemap_google_products.xmlSave the file to your working directory.
Step 2: Extract product URLs:
Run this in your terminal from the same directory:
sed -n '/<g:link>/,/<\/g:link>/ s/.*\(https:[^ ]*\).*/\1/p' sitemap_google_products.xml > product_urls.txt
This parses the <g:link> tags in the Google Product feed and outputs each product URL to product_urls.txt.
Option 2: One-Liner Using curl (No Manual Download)
This method fetches and parses the sitemap in a single command, no need to download the file first.
curl -sL "https://www.yourstore.com/sitemap_products.xml" \ | sed -n 's/.*<loc>\(.*\)<\/loc>.*/\1/p' \ > product-urls.txt
What it does:
-
curl -sLsilently fetches the sitemap (follows redirects). -
sedextracts the URL from each<loc>...</loc>tag. -
> product-urls.txtwrites all URLs to a text file in your current directory.
Before You Run
⚠️ Replace
www.yourstore.comwith your actual webstore domain in any command above. For example, if your store iswww.example-store.com:curl -sL "https://www.example-store.com/sitemap_products.xml" \
| sed -n 's/.*<loc>\(.*\)<\/loc>.*/\1/p' \
> product-urls.txt
Output
Both methods produce a plain text file with one product URL per line:
https://www.yourstore.com/product-name-1/
https://www.yourstore.com/product-name-2/
https://www.yourstore.com/category/product-name-3/
...Conclusion
Use your webstore's built-in XML sitemaps to quickly export all product URLs without needing database access or admin exports.