Tuesday, July 1, 2008

Easily add a sitemap to Drupal CMS 6.x !

Hi geeks !!


So you want to add a sitemap to your drupal based website ?
IMHO, Drupal CMS is probably the best CMS available at the moment. It has so many features, and it's so extensible that there's probably nothing you can't do with it.

That's being said, I had to do a bit of research to find a simple way to have at the same time :

- search engines- and user- friendly urls (i.e http://mysite.com/whats-new instead of http://mysite.com/node/377)

- an xml sitemap that you can use in most search engines

Drupal CMS has a module called xmlsitemap, but I never managed to make it work properly. Apparently this is due to some bugs in the code, though I'm not sure.

Ok, so what to do ?

Thanks to ramiro at SEO expert blog, we have a quite simple solution to automatically create a sitemap with nodes and the front page however, I was surprised that they didn't package the code into a module, so I decided to do it.

You can find the module here. Please note that I only did really small modification to the code, and all the tricky parts have actually been written by Ramiro.

How to install ?
Note that you need Drupal 6.x with pathauto module installed and configured.

- unzip and copy the sitemap folder into your the 'modules' folder of your Drupal installation
- go to Administer -> Site building -> Modules
- activate the module by checking the box next to 'sitemap' (in 'other' category)
- Go to http://{your drupal site url}/sitemap.xml

You should have a nice xml sitemap appearing !

More information here

Hope it works for you,

cheers

D.

6 comments:

curiousEngine said...

Cool, this module works for me. Have to wait for Google Webmaster now..

CyberMage said...

Looks good, but only returns a few URL's - not every node.

Anshul Agrawal said...

can u please give an alternate link. the link given in this post in not working. or alternativley mail the module to helloanshul@gmail.com
thanks
anshul

Michael said...

It works thanks. But how can I delete a url that I don't want to appear - I have updated the robot.txt but it still comes up on the site map?

Peter said...

Any chance you could email that code? FileFactory keeps asking me to upgrade.

Joao said...

Hi,

Can you please send me that code to joao.garin@gmail.com?

Best regards,
Joao Garin