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
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
It also Includes a great sitemap menu so that you can choose yourself what you want indexed in the sitemap such as following:
Negative
If you like this post feel free to digg it
{ 4 comments… read them below or add one }
If someone has an idea on how to make this work with Moz I would be glad.
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
Ok thx! This gives me a clue on what to do
I´ll try later on, Thanks / Marcus
Working on it right now!