Sitemap Creator for Wordpress
Sitemap is a basic xml file that holds information about your site. There is a small plugin for wordpress which can be found at
http://www.arnebrachhold.de/2005/06/05/google-sitemaps-generator-v2-final . I downloaded and put it under the plugins then i set up the frequency mostly for daily since i am writing here nearly everyday. (it has been only 2 days since we started this project).
I created the xml and it automatically pinged google. But to be sure i went to google sitemaps acount and manually inserted the address of my sitemap. Then remembered the Yahoo page that i used to submit my feed rss i went to that page and submit my sitemap.xml.gz there too.
After a time i did those i had the idea (maybe it was just a coder instict) i thought i may change the code of sitemap creator so that it can ping yahoo and ask . Well it was so easy to code that i search for the code for seconds and find out where i have to change.
You may do it also it is really easy. Find the sitemap.php and change the code like this
$sitemapURL=$pingUrl;
//Ping Yahoo
if(sm_go(”sm_b_ping”) && $pingUrl!=”") {
$pingUrl=”http://search.yahooapis.com/SiteExplorerService/V1/updateNotification?appid=YahooDemo&url=” . urlencode($pingUrl);
$pingres=@wp_remote_fopen($pingUrl);if($pingres==NULL || $pingres===false) {
$messages[count($messages)]=str_replace(”%s”,”<a href=\”$pingUrl\”>$pingUrl</a>”,__(”Could not ping to Yahoo at %s”,’sitemap’));
} else {
$messages[count($messages)]=str_replace(”%s”,”<a href=\”$pingUrl\”>$pingUrl</a>”,__(”Successfully pinged Yahoo at %s”,’sitemap’));
}
}//Ping Google
if(sm_go(”sm_b_ping”) && $sitemapURL!=”") {
$pingUrl=”http://www.google.com/webmasters/sitemaps/ping?sitemap=” . urlencode($sitemapURL);
$pingres=@wp_remote_fopen($pingUrl);if($pingres==NULL || $pingres===false) {
$messages[count($messages)]=str_replace(”%s”,”<a href=\”$pingUrl\”>$pingUrl</a>”,__(”Could not ping to Google at %s”,’sitemap’));
} else {
$messages[count($messages)]=str_replace(”%s”,”<a href=\”$pingUrl\”>$pingUrl</a>”,__(”Successfully pinged Google at %s”,’sitemap’));
}
}
//Ping ASK
if(sm_go(”sm_b_ping”) && $sitemapURL!=”") {
$pingUrl=”http://submissions.ask.com/ping?sitemap=” . urlencode($sitemapURL);
$pingres=@wp_remote_fopen($pingUrl);if($pingres==NULL || $pingres===false) {
$messages[count($messages)]=str_replace(”%s”,”<a href=\”$pingUrl\”>$pingUrl</a>”,__(”Could not ping to ASK at %s”,’sitemap’));
} else {
$messages[count($messages)]=str_replace(”%s”,”<a href=\”$pingUrl\”>$pingUrl</a>”,__(”Successfully pinged ASK at %s”,’sitemap’));
}
}
I have bolded the important parts.