Debugging your XML sitemap with an XSL Stylesheet

When you’re developing XML sitemaps, no matter on what platform, it’s pretty hard to debug them sometimes to be proper XML. You have to validate all the time and you can’t do a quick “glance” over to see whether your sitemap has the URL’s you were expecting.

As mentioned before I’m working on my WordPress SEO plugin, and it’ll do sitemaps, three kinds of sitemaps actually: video, news and normal. For all three of them I’ve developed so called XSL stylesheets, so I can quickly glance over a sitemap and get an idea as to whether everything I expected to be in there is actually there. An XSL stylesheets transforms an XML document into HTML output, for instance, for a normal XML sitemap, that looks like this:

Styled XML Sitemap

Click for larger image

And for an XML video sitemap:

Styled XML Video Sitemap

Click for larger image

Especially with the recent addons to the sitemaps protocol (check out the image count in the first “normal” sitemap for instance), this makes it a lot easier to see if you’re doing things wrong. On top of that, using some jQuery, the headers are sortable!


Because I know you want your own XML sitemaps to look this good too, I’ll release my XSL stylesheets here:

XSL stylesheets for XML Sitemaps


Usage of these XSL stylesheets is easy, just add a line like this to the top of your XML output:

<?xml-stylesheet type='text/xsl' href='/url/to/xsl-stylesheet.xsl'?>

Let me know whether you like this, and what you’d like to add to these XSL stylesheets!

Become a Yoast SEO plugin expert!

  • Master the Yoast SEO plugin
  • Get the best settings for your site
  • Don’t miss out on awesome features
  • On-demand SEO training by Yoast
More info

13 Responses to Debugging your XML sitemap with an XSL Stylesheet

  1. Paul
    Paul  • 9 years ago


    I am having such problems submitting my site map. I think I do it exactly as indicated but always seem to get an error. I am not an idiot. Please tell me when you release a plugin I am getting dishearten with trying to make any money online.

  2. rob
    rob  • 9 years ago

    I am a fan of yours, I used almost all your plugin and been waiting for your SEO Plugin…
    This one also is good…

  3. Jared Detroit
    Jared Detroit  • 9 years ago

    Thanks for the style sheets. These will be a much needed addition to my sitemaps. Not only for me but also for my clients. It’s always good to show them what you’ve created, for something like a video sitemap, in a good format. Thanks!

    I’m really looking forward to this SEO plugin and I’m excited to hear it’s going to be more of an all exclusive plugin with sitemaps included. That will make my life a little easier installation.

  4. JB
    JB  • 9 years ago

    Cool, just what I am looking for. Keep up the good the work

  5. Jen
    Jen  • 9 years ago

    That plugin is desperately needed – to many separate plugins right now to do these functions: one for URLs, one for Video, etc
    Bring on the plugin Joost!

  6. DB Baker
    DB Baker  • 9 years ago

    Thanks Yoast, it looks great.

    Any idea when your WordPress SEO Plugin is going to be finished and released to the public?

    • Joost de Valk

      That’ll take a couple of months :)

      • DB Baker
        DB Baker  • 9 years ago

        Cool. Just one more question. If I am running thesis would your plugin provide an edge over the built in SEO functions that are coming with the thesis theme ?

        • Joost de Valk


  7. jakob
    jakob  • 9 years ago

    Thanks, I desperately needed this info!

  8. Sam
    Sam  • 9 years ago

    Nice work Joost!
    Emma, Like Joost said for 1,2) it is not a good idea to host your video on multiple pages, if you have to to do it, then just pick one URL regardless of the macro.

  9. Emma B
    Emma B  • 9 years ago


    I am currently in the process of putting together a video sitemap but have a couple of questions:

    1) If you have the same video on a couple of URLs do you have to do a reference for each URL or is is acceptable to put several URLs in one reference?
    2) What do you put as the URL if the video is part of a macro that is placed on several pages as a result of being copied across from the CSS?


    • Joost de Valk

      1: pick one URL and go for that, don’t host the same video on multiple pages, especially not for Google.
      2: I don’t get this question :)