Plugin: Google XML Sitemaps
In the good old days, web spiders employed by the search engines has to earn their keep. They had to crawl each page to find links to other pages and so slowly discover the world wide web. Its a good way of finding every page, but it is also very time consuming.
Chewing on their links these spiders thought: wouldn’t it be easier if every website just published a list of all its pages, nicely XML formatted ? And that is what happened, Google published a specification for a sitemap.xml file and asked web publishers to add one to their website to reduce the need to go over each site completely, time and time again.
Yahoo, ASK and MSN quickly adapted and now support XML encoded sitemaps as well.
When using Wordpress, one of the must-have plugins is the Google XML Sitemaps plugin. After installing the plugin will create and update a sitemap.xml for your entire blog after each new post ; and for good measure send a ping to Google/MSN/Ask/Yahoo to let them know you have updated your sitemap.
Installing it is straightforward and after it runs you can forget about it.
Now you have a sitemap.xml file, you can optionally tell Google the good news through the Google Webmasters tools site. If there is anything wrong with it, Google will tell you, but its highly unlikely.

Advanced
If you are writing your own plug ins, and especially if they generate dynamic content, you will like the Google XML Sitemap plugin’s ability to be extended. My Wordpress Theme Gallery plug in creates virtual pages for each theme added. These are invisible to Wordpress, so they do not get added to the sitemap. A few lines of code solved this problem:
function bm_gallery_sitemap()
{
$generatorObject = &GoogleSitemapGenerator::GetInstance();
if($generatorObject!=null)
{
// Get a listing of all the active themes in the database
$active_themes = bm_gallery_db_getallactive();
if ($active_themes)
foreach ($active_themes as $row)
$generatorObject->AddUrl(BM_GALLERY_URL . '?d=' .
$row['theme_id'],time(),"weekly",0.4);
}
}
/* If active, setup the sitemap hook */
if (BM_GALLERY_SITEMAP) add_action("sm_buildmap","bm_gallery_sitemap");
Spider Web by martinkreyness

Leave a Reply