How to add an external sitemap to the index

Our Yoast SEO plugin creates sitemaps on the fly for the content within WordPress. In some cases, you may have sitemaps for other parts of your site that you want to add to our sitemap index.

For this purpose, we introduced the wpseo_sitemap_index filter. You will find an example of how to use the filter here.

The last mod date is hardcoded so it would not update automatically with this code. If you would like to update the last mod automatically we suggest developing on the plugin or hiring someone. We highly recommend checking out Code Poet for available freelance WordPress developers.

In addition to the Yoast SEO plugin, we have several other WordPress plugins that optimize specific aspects of your site, like video.

Troubleshooting

  1. If posts fail to appear on the external sitemap try to disable and re-enable the sitemaps using this guide.
  2. Clear all your caching from all your plugins, themes, and hosting such as server caching
  3. Add rules for common caching plugins to exclude sitemaps from caching using this guide.
  4. Disable the transient sitemap caching using this guide.

Related articles

Get free SEO tips!