Create a user friendly sitemap

by Marcus Westberg on January 29, 2006

in General, SEO tips & tricks, Web Tools

Create a user friendly sitemap

This is a post on how to create a user friendly sitemap for Wordpress blogs.

Do this and you have a autogenerating user friendly sitemap.

This is how it looks: Sitemap

This Includes 2 steps

  • 1: Make an autogenerating xml sitemap compatible with Google sitemaps.
  • 2: Install a stylesheet for the xml sitemap.
  • STEP 1

    Download and install the XML sitemap generator

    Link to plugin site: google-sitemaps-generator-v2-final

    Send in your sitemap to Google sitmaps.
    If you do not already have a Google sitemap account sign up here

    You should now have a fully working .xml Google sitemap.

    STEP 2

    Visit Enarion.net and download gss-1.5a.zip

    Upload the file to your server.

    Now as you can see at the style sheet page you are instructed to add:

    < ?xml-stylesheet type="text/xsl" href="gss.xsl"?>
    directly under
    < ?xml version="1.0" encoding="UTF-8"?>

    in your sitemap.xml file.

    But the problem is that each time your sitemap.xml file gets regenerated it over writes your precious < ?xml-stylesheet type="text/xsl" href="gss.xsl"?> command.

    How do we solve the problem then?

    Just add this piece of code in your sitemap.php file which should be located at: /yourdomain.com/wp-content/plugins/sitemap.incl.lang/

    $s=’< ?xml-stylesheet type="text/xsl" href="gss.xsl"?>‘. “\n”;

    The code should be placed directly under:
    $s=’< ?xml version="1.0" encoding="UTF-8"' . '?' . '>‘. “\n”;

    (If you can not find that piece of code use the search function on your FTP client.)

    That´s it! now your sitemap.xml is compatible both to Google sitemaps and for visitors to use.

    See the result and how it looks for this domain: Westberg Sitemap

    Positive

  • You get an autogenerating sitemap
  • Your visitors can easy use the sitemap and its functions
  • You get the .xml file to be usable for both Google and visitors
  • Very easy to implement
  • It also Includes a great sitemap menu so that you can choose yourself what you want indexed in the sitemap such as following:

  • Include homepage
  • Include posts
  • Include static pages
  • Include categories
  • Include archives
  • Negative

  • You will have 11 external links on your sitemap
  • Have not figured out how to make it work with firefox
  • If you like this post feel free to digg it

    { 4 comments… read them below or add one }

    Marcus Westberg January 29, 2006 at 7:22 pm

    If someone has an idea on how to make this work with Moz I would be glad.

    Ingwar February 3, 2006 at 1:59 pm

    I found why your XSLT dont want to work witch Firefox.
    It needs good headers to work..
    You need to add “Content-Type: text/xml” to both sitemap.xml and gss.xml and take care abot encoding.. because now its not xslt is nit properly UTF-8 encoded.

    It works on both IE and Firefox

    Marcus Westberg February 3, 2006 at 3:07 pm

    Ok thx! This gives me a clue on what to do :)
    I´ll try later on, Thanks / Marcus

    Ivan Minic February 7, 2006 at 11:37 pm

    Working on it right now!

    Leave a Comment

    Previous post:

    Next post: