
Having problem getting Drupal 6 XML Sitemap module to work? I realize this is in beta but looking at the documentation, there were no open issues. If your sitemap isn't being generated, here's some tips on how to make it work.
So you tried to get Druapl XML Sitemap running, did the cron multiple times, stood on your head and it still didn't work. I know. I been there and it is a real pain isn't it?
So you headed over to the documentation and read through it. But you quickly realized that the screen shots were nowhere near to what you were seeing in your admin panel.
Forget all that and follow these instructions.
Download, extract, FTP and install XML Sitemap in the Modules directory. And while you are at it, clear the cache too just in case.
Go to the Search Engines menu and check the boxes off what search engines you want to submit to. If you are a real time website that just has to get your info out there quickly, set the submission time to every 5 minutes. For all other sites, its best to set this to something more reasonable like 1 hour or 1 day. Also make sure the checkbox to submit only if the sitemap has been updated is set.
Now here's something that isn't mentioned in the handbook - what content type should be set for the sitemap. What you need to do here is go to Content Management | Content Types and edit each type's XML sitemap to be included. Here is where you can also adjust the default priority for each content type.
Go to the Settings menu. Click the advanced settings dropdown and familarize yourself with the info especially the location of the cache directory of the sitemap. In a multisite Drupal installation the default site will have a location of:
sites/default/files/sitemap.xmlAll other sites will have:
http://www.your-site-name.com/files/sitemap.xmlNote the number of links to process on a rebuild. I have mine set to 500. If you have more than 500 links to process in your website you are going to have to run rebuild multiple times. Think of this as chunking. Because sitemaps can be huge it takes a lot of server processing so you have to chunk things so your server doesn't time out.
While you are in the settings menu, click the frontpage, taxonomy, users, content, and menu drop downs. They will show you statistical information and whether those content types are included or excluded in the sitemap. You basically are going to want to have the front page, taxonomy and content types included. Depending on your site's privacy policy, you may not want user information included in the sitemap.
Ok here is where we get around the problem of your sitemap not being generated. Create a sitemap.php file and type in the following code. Place it in the root directory and then run it.
<?php echo "Running sitemap...";
module_invoke_all('xmlsitemap_links');
?>Delete the sitemap.php. You don't need it anymore.
Having performed this on a multisite Drupal installation, we only had to run the module invocation once for all sites.
At this point, your sitemap data should be created and exist in your database. If you really want to see if your sitemap data exists you can use phpmyadmin or a similar database viewer tool to look at the xmlsitemap table. If there is no data, you got something wrong with your database and need to fix it.
Now go to the Site Configuraton | XML Sitemap menu and then click on the Rebuild Links menu Look for the the Rebuild sitemap button and click it. You should then see on the screen a status bar indicating the progress of the rebuild.
You shouldn't have to click on this button in the future unless absolutely necessary. Realize that if you got a big website full of nodes and pages, it is going to take a long time to generate. So use this sparingly. With every new content you submit to Drupal, it should automagically add the content to the xml sitemap database.
With your FTP browser, look in your site/site-name-here/xmlsitemap folder and you should see a sitemap file generated. The filename may look strange but don't be concerned. Simply go to your browser and type:
http://www.your-site-name.com/sitemap.xmlYou should now see your entire sitemap presented.
If you are not seeing your sitemap being updated, you need to go to the sitemap file and give appropriate file permissions to it. I noticed that when this is not set to 755, the sitemap will not update.
IF you need to uninstall XMLSitemap and reinstall it, you could do the following:
Rebuild the sitemap and then update the cache. Run cron.php multiple times (depends on the number of links you want to process per chunk). Check the Xml sitemap list links to see if its accurate.
This article was only going to discuss how to get XML Sitemap working but lets take this one step further. Let's get the search engines to recognize your sitemap.
Head to the Google Sitemaps service and submit a sitemap. When prompted use the following path:
http://www.your-site-name.com/sitemap.xmlGoogle will immediately download your sitemap and parse it to show you the URLs they submitted and what was has already been indexed. Ideally, over time, these two numbers should be the same and if they aren't give it some time as Google spiders will crawl those pages not indexed.
Login to your Bing webmaster account.
You will be asked for site ownership. Use the meta tag option and place the tag in your front page. Click on the Sitemaps menu along the left side of the portal, then on the Add Sitemap button.
Once again enter in the following sitemap URL:
http://www.your-site-name.com/sitemap.xmlYou will have to wait a few days until Bing crawls your site.
Go to Yahoo! Site Explorer and login with your Yahoo! company address.
Add your website. You will then be asked for site ownership. Use the meta tag option and place the tag in your front page.
Click on the submit site feed drop down and enter in your sitemap URL:
http://www.your-site-name.com/sitemap.xml