Skip to content Skip to navigation

My XML sitemap doesn’t work or return errors

Do not cache your XML sitemaps

If you can’t see your XML sitemap or you get this error from Google Search Console “Your file appears to be an HTML page“:

My XML sitemap returns a 404 error

Flush your permalinks from Settings, Permalinks each time you include or exclude a new post type or taxonomy to your sitemap.

Read our guide if you still see a 404 error

NGINX user?

You must add several rewrite rules to your NGINX configuration file. Contact your webhost to take of this.

Google Search Console returns errors

Generating an XML sitemap for your images is a daunting task, especially if you are using shortcodes to display your images.

My XML sitemap is blank

XSL issue

There may be a problem with the stylesheet associated with the XML sitemap. It may not be loading or has been altered via your theme or a third-party plugin.

Generally, by looking at the source code of the stylesheet, we can quickly find the culprit.

URL of the stylesheet:

WP Debug

Or, if your index sitemap and / or sub-sitemaps are blank, including your source code, you have to enable the WP Debug feature to get the error. Once the debug is enabled, load again your XML sitemap. The error will appear in your debug.log file.

A URL is missing in my sitemap

Make sure you don’t have set your URL as noindex.

If you have set a custom canonical tag different from your permalink, it will be automatically excluded from the sitemap too to follow Google guidelines.

The source code of my sitemaps shows “extra code”

If you see some PHP or JS scripts related to a third party plugin, you can try to disable shortcode execution by adding this snippet to your functions.php file of your child theme (you can also use a must use plugin if you prefer or if you don’t have this file available, eg Oxygen builder):

My sitemap is too slow

Try to disable Image sitemaps option from the General settings.

My XML sitemap still doesn’t work

Open a support ticket from your customer area. If you’re a Free user, create a topic on forum.