Skip to content

How to Generate a Sitemap?

MPG requires its sitemap to be generated since the generated pages aren't your typical WordPress entities. MPG entities are kept as 'virtual'. Though it has no negative SEO effect, since most frameworks and systems generate 'virtual' pages as well, it is an important differentiation for WordPress sites, as WordPress generates its sitemap from entities registered in its database.

✅ Prerequisite: Verify Your Page Count

Before generating a sitemap, confirm that your MPG project is showing a page count greater than zero.

  1. Go to your MPG project in the WordPress dashboard.
  2. Check the page count displayed in the project overview.

📝 Important: If the page count shows 0, the sitemap will fail. See Troubleshooting Zero Pages below before proceeding.

Steps to Generate a Sitemap

1. Go to your MPG project.

2. At the very top of the page, select the Sitemap tab.

3. Give your sitemap a name, preferably without spaces. Example: mpg-sitemap.

4. Unless you have a specific goal, leave the rest of the settings as they are and press the Save and generate button.

5. Copy the Current sitemap URL in the bottom right-hand corner of the table. Add the MPG sitemap as an additional sitemap in Google Search Console.

6. Manually check a couple of URLs through Google Search Console to confirm indexability. You can also watch the short tutorial video below for a step-by-step walkthrough:

📝 Note: If you open the XML sitemap, you may get a warning that the file doesn't contain "styles". That is OK, as this file is for search engines only.

🔧 Troubleshooting Zero Pages

If your project shows 0 pages, it usually means the data source connection has been lost or the source file has not been loaded correctly. Follow these steps to restore it:

1. Open your MPG project and go to the Source tab.

2. Check which source type you are using:

  • Uploaded file (CSV/XLSX/ODS): Re-upload your file by clicking Browse and selecting the file again.
  • Direct link (Google Sheets or remote CSV): Verify the link is still publicly accessible, then click Fetch and use to re-sync the data.

3. Once the data loads, click Save (or Save and generate on the Sitemap tab) to regenerate the project pages.

4. Return to the project overview and confirm the page count is now greater than zero before attempting to generate the sitemap again.

If you are using a Google Sheets link, make sure the sheet is set to Anyone with the link can view before fetching. Private sheets will return no data.

⚠️ Common Error: "To create sitemap, call addUrl or addUrls function first"

This error appears when the sitemap generator runs but finds no URLs to include — which happens when the project page count is zero.

How to fix it:

  1. Follow the Troubleshooting Zero Pages steps above to restore your data source.
  2. Once your page count is greater than zero, go to the Sitemap tab and click Save and generate again.

If the page count is correct but the error persists, check the WordPress base path settings under MPG → Advanced Settings and ensure the base path matches your site URL.

Troubleshooting: sitemap has fewer URLs than expected

If your sitemap is generated but shows fewer URLs than your MPG project page count, use this checklist:

  1. Confirm the project page count first in your MPG project overview. If the count is lower than expected, fix your source data before checking the sitemap.
  2. If you updated the source file or source link, open the Source tab and sync it again:
    • Uploaded file (CSV/XLSX/ODS): Upload the latest file version.
    • Direct link (Google Sheets or remote CSV): Click Fetch and use to pull the latest rows.
  3. If you changed URL-related project settings (for example, the URL Format Template or base path), go to the Sitemap tab and click Save and generate again.
  4. If you use multiple MPG projects, make sure you are checking the Current sitemap URL from the correct project and that each project uses a different sitemap File name.
  5. If the XML still shows an older count, clear plugin/server/CDN/browser cache and recheck in an incognito window.

Check whether the sitemap was split into multiple files

The Max URLs per sitemap file setting controls how many URLs MPG puts in one XML file. If your total generated URLs are higher than this limit, MPG creates:

  • one sitemap index file, and
  • multiple child sitemap files.

In this case, do not count only the first file. Open the sitemap index and check all child sitemap files to verify the full URL total.

Verify the generated URL list before regenerating the sitemap

Before regenerating the sitemap, verify that MPG is generating the expected unique URL list:

  1. Open your MPG project and review See all URLs (URL preview) for the generated list.
  2. Compare those URLs with your source rows, especially the columns used in the URL Format Template.
  3. Fix rows with empty values, duplicate values, or non-unique value combinations that can produce duplicate URLs.
  4. Save your project updates, then return to Sitemap and click Save and generate.

Troubleshooting Sitemap URLs

Sitemap URLs show an IP address instead of your domain name

If your MPG sitemap URLs show a server IP address (e.g., http://123.45.67.89/your-page/) instead of your domain, Google Search Console may report indexing errors. This is not an MPG bug — MPG reads the site URL from WordPress and does not rewrite it. The issue is typically caused by a misconfigured WordPress Site Address, a stale cache, or a reverse proxy on the server.

To fix it, work through these steps in order:

  1. Check your WordPress Site Address: Go to Settings > General and make sure both the WordPress Address (URL) and Site Address (URL) fields show your domain name, not an IP. Update if needed and click Save Changes.

⚠️ Important: Changing these URL fields can affect logins and redirects. Verify both values carefully before saving.

  1. Regenerate the sitemap: In your MPG project, open the Sitemap tab and click Save and generate so MPG picks up the correct URL.

  2. Clear all caches: Purge your caching plugin (WP Rocket, LiteSpeed Cache, etc.), any server-level cache (Nginx, Varnish), and your CDN cache (Cloudflare, BunnyCDN) to remove any stale sitemap copies.

  3. Still seeing an IP? A reverse proxy or server rewrite rule may be replacing your domain. Contact your hosting provider and ask them to check their server configuration.

Once the issue is resolved, open the sitemap in a browser to confirm domain names appear, then re-submit it in Google Search Console > Sitemaps and monitor the Coverage report.

💡 Tip: To find your sitemap URL, go to the Sitemap tab in your MPG project and copy the Current sitemap link shown at the bottom of the table.

🗂 Useful Resources

🎥 How to generate a sitemap using MPG?