Troubleshooting Empty or Missing Sitemaps in XML Sitemap Generator for Google
Content
Encountering an empty sitemap or a missing sitemap file is a common issue reported by users of the 'XML Sitemap Generator for Google' plugin. This problem can prevent search engines from properly indexing your site and often manifests as a blank page when visiting yoursite.com/sitemap.xml or specific sitemap files like sitemap-pt-postname.xml being empty. Based on community reports and fixes, here’s a breakdown of why this happens and the most effective solutions.
Why Does This Happen?
The root cause often lies in one of a few key areas:
- Plugin Conflicts: Other plugins, especially SEO plugins like Yoast SEO or Jetpack that also generate sitemaps, can cause conflicts.
- Physical File Conflicts: A lingering physical
sitemap.xmlorsitemap.xml.gzfile in your website's root directory can override the dynamic sitemap generated by the plugin. - Custom Post Types & Taxonomies: A known bug in older plugin versions incorrectly handled custom taxonomies and some post types, leading to empty sitemap files for those content types.
- Permalink Structure: An incorrect or unflushed permalink structure can break the plugin's URL routing.
- Code Errors: Whitespace or errors in a theme's
functions.phpfile can corrupt the XML output, resulting in a blank page.
Common Solutions to Try
1. Check for and Delete Physical Sitemap Files
This is the most frequent solution. The plugin generates sitemaps dynamically, but if an old, physical file exists on your server, it will be served instead, often appearing blank.
- Access your website's root directory via FTP or your hosting provider's file manager.
- Look for and delete any files named
sitemap.xml,sitemap.xml.gz, or any file starting withsitemap-. - Return to your WordPress admin area and try to access the sitemap again. The plugin should now generate it dynamically.
2. Resolve Plugin Conflicts
If you have multiple sitemap plugins active, you must choose one.
- Go to Plugins → Installed Plugins.
- If you have Yoast SEO, Jetpack, or another SEO plugin, navigate to its settings and disable its sitemap generation feature. This is usually found in the 'XML Sitemaps' or 'Webmaster Tools' section of the other plugin's settings.
- If you wish to use 'XML Sitemap Generator for Google', ensure all other sitemap plugins are deactivated entirely.
3. Flush Your Permalink Structure
This refreshes WordPress's URL rewrite rules, which the plugin relies on.
- Go to Settings → Permalinks.
- Without making any changes, simply click the "Save Changes" button at the bottom of the page.
4. Review Custom Content Type Settings
If sitemaps for specific custom post types or taxonomies (like categories) are empty, check your plugin settings.
- Go to Settings → XML-Sitemap.
- Under "Sitemap Content," ensure the checkboxes for your custom post types and taxonomies are selected.
- If the problem persists specifically for categories, a temporary workaround mentioned in the community is to deselect "Include categories" to prevent the generation of an empty file, though this is not an ideal long-term solution.
5. Check for Code Errors
A blank XML file can sometimes be caused by a PHP error or whitespace in your theme's code.
- Temporarily switch to a default WordPress theme like Twenty Twenty-Four.
- Check if the sitemap works. If it does, the error is likely in your regular theme's code, often in the
functions.phpfile. - Enable
WP_DEBUGin yourwp-config.phpfile to see if any errors are logged when the sitemap is generated.
When to Suspect a Bug
If you have tried all the above and your sitemap for a custom taxonomy remains empty, you may be experiencing a bug that was identified and fixed by the community. The issue involved the plugin misidentifying custom taxonomies. The 'XML Sitemap Generator for Google' team has indicated this fix is included in a subsequent release. Ensuring your plugin is updated to the latest version is the best course of action.
By methodically working through these steps, most users can resolve issues with empty or missing sitemaps and get their XML sitemap functioning correctly again.
Related Support Threads Support
-
Taxonomy-sitemap missing in sitemap-indexhttps://wordpress.org/support/topic/taxonomy-sitemap-missing-in-sitemap-index/
-
Where is Sitemap.xml file installedhttps://wordpress.org/support/topic/where-is-sitemap-xml-file-installed/
-
Sitemap not generatedhttps://wordpress.org/support/topic/sitemap-not-generated-2/
-
no sitemap.xml generatedhttps://wordpress.org/support/topic/no-sitemap-xml-generated/
-
Sitemap.xml is blankhttps://wordpress.org/support/topic/sitemap-xml-is-blank-4/
-
Blank stylesheet.xmlhttps://wordpress.org/support/topic/blank-stylesheet-xml/
-
File is not generatedhttps://wordpress.org/support/topic/file-is-not-generated/
-
Don’t find sitemap.xml on my roothttps://wordpress.org/support/topic/dont-find-sitemap-xml-on-my-root/
-
Sitemap for Static Website Generatorhttps://wordpress.org/support/topic/sitemap-for-static-website-generator/
-
No Sitemap.xml File Generatedhttps://wordpress.org/support/topic/no-sitemap-xml-file-generated/
-
empty sitemap file name in robots.txthttps://wordpress.org/support/topic/empty-sitemap-file-name-in-robots-txt/
-
“Still a sitemap in your directory”https://wordpress.org/support/topic/still-a-sitemap-in-your-directory/
-
Where is the xml file?https://wordpress.org/support/topic/where-is-the-xml-file/
-
SItemap for post type not generatinghttps://wordpress.org/support/topic/sitemap-for-post-type-not-generating/
-
Empty site map fileshttps://wordpress.org/support/topic/empty-site-map-files/
-
facing white blank space in sitemap.xml problem.https://wordpress.org/support/topic/facing-white-blank-space-in-sitemapxml-problem/
-
Custom taxonomy sitemap file is emptyhttps://wordpress.org/support/topic/custom-taxonomy-sitemap-file-is-empty/
-
How do you EXPORT the sitemaphttps://wordpress.org/support/topic/how-do-you-export-the-sitemap/
-
Sitemap is blankhttps://wordpress.org/support/topic/sitemap-is-blank-1/
-
How to create a page with physical sitemap?https://wordpress.org/support/topic/how-to-create-a-page-with-physical-sitemap/
-
Sitemap page blankhttps://wordpress.org/support/topic/sitemap-page-blank/
-
Custom Taxonomy sitemap not createdhttps://wordpress.org/support/topic/custom-taxonomy-sitemap-not-created/
-
No URLs show up in the sitemaphttps://wordpress.org/support/topic/no-urls-show-up-in-the-sitemap/
-
Shortcodes for XML Sitemap Generator for WordPress 4.0.9https://wordpress.org/support/topic/shortcodes-for-xml-sitemap-generator-for-wordpress-4-0-9/
-
empty sitemaphttps://wordpress.org/support/topic/empty-sitemap-6/
-
Sub site maps are emptyhttps://wordpress.org/support/topic/sub-site-maps-are-empty/
-
Empty sitemap for custom post typehttps://wordpress.org/support/topic/empty-sitemap-for-custom-post-type/
-
"There is still a sitemap.xml or sitemap.xml.gz file" errorhttps://wordpress.org/support/topic/there-is-still-a-sitemapxml-or-sitemapxmlgz-file-error/
-
Page not foundhttps://wordpress.org/support/topic/page-not-found-399/
-
Sitemap not generating properlyhttps://wordpress.org/support/topic/sitemap-not-generating-properly/
-
wp-sitemap.xmlhttps://wordpress.org/support/topic/wp-sitemap-xml/
-
sitemap-tax-category.xml missing – fixedhttps://wordpress.org/support/topic/sitemap-tax-categoryxml-missing-fixed/
-
Error with Yoaest SEO plug inhttps://wordpress.org/support/topic/error-with-yoaest-seo-plug-in/
-
Empty sitemap-misc.xmlhttps://wordpress.org/support/topic/empty-sitemap-misc-xml/
-
Google XML Sitemaps is installed but I where is the user interface ?https://wordpress.org/support/topic/google-xml-sitemaps-is-installed-but-i-where-is-the-user-interface/
-
Posts not showing on sitemap.xmlhttps://wordpress.org/support/topic/posts-not-showing-on-sitemap-xml/
-
Can’t access defaut sitemap after uninstallinghttps://wordpress.org/support/topic/cant-access-defaut-sitemap-after-uninstalling/
-
Where Storing Data For sitemap.xmlhttps://wordpress.org/support/topic/where-storing-data-for-sitemap-xml/
-
The page-sitemap.xml lines do redirect to the homepagehttps://wordpress.org/support/topic/the-page-sitemap-xml-lines-do-redirect-to-the-homepage/
-
sitemap.xml blankhttps://wordpress.org/support/topic/sitemap-xml-blank/
-
Sitemap filename is not as expectedhttps://wordpress.org/support/topic/sitemap-filename-is-not-as-expected/
-
sitemap.xml emptyhttps://wordpress.org/support/topic/sitemap-xml-empty/
-
Sitemap simply doesn’t workhttps://wordpress.org/support/topic/sitemap-simply-doesnt-work/
-
Blank xml pagehttps://wordpress.org/support/topic/blank-xml-page/
-
post site map have zero itemhttps://wordpress.org/support/topic/post-sire-map-have-zerp-item/
-
Empty sitemapshttps://wordpress.org/support/topic/empty-sitemaps/
-
no XML sitemap createdhttps://wordpress.org/support/topic/no-xml-sitemap-created/
-
No sitemap fileshttps://wordpress.org/support/topic/no-sitemap-files/