Create a user friendly sitemap

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 thoughts on “Create a user friendly sitemap

    1. 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

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>