Sitemaps help web crawlers to do a better job of crawling your site. If your content is continously updated, then you should let the search engines know that your XML file of all your site links has been updated. To date, Ask, Google, MSN, and Yahoo support the Sitemap 0.90 protocol. Visit sitemaps.org for the sitemap XML format, if you haven’t already created one. There are also websites that will create a sitemap for you.
Here is a solution you can use in your ColdFusion applications which will alert the four major search engines that your sitemap has been refreshed.
The code is fairly easy. First, we wrap our code in a <cftry> with a <cfcatch> if something goes wrong. Then, we use the <cfhttp> tag to send a request to the sitemap ping service specified by the particular search engine. The "redirect" attribute is important because, by default, <cfhttp> will redirect to the URL specified in the tag. We choose "no" to allow for multiple pings in one process. After the ping is made to the service we set a variable for the header status code. 200 OK is a successful request and 404 Not Found means the page was not accessed. Once all of the selected pings have run, the use <cfmail> to email the results.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | <cftry> <cfhttp url = "http://submissions.ask.com/ping?sitemap= http://YOURDOMAIN/sitemap.xml" redirect = "no"> </cfhttp> <cfset AskPingStatus = cfhttp.statusCode> <cfhttp url = "http://www.google.com/webmasters/sitemaps/ping?sitemap= http://YOURDOMAIN/sitemap.xml" redirect = "no"> </cfhttp> <cfset GooglePingStatus = cfhttp.statusCode> <cfhttp url = "http://webmaster.live.com/ping.aspx?sitemap= http://YOURDOMAIN/sitemap.xml" redirect = "no"> </cfhttp> <cfset MSNPingStatus = cfhttp.statusCode> <cfhttp url = "http://search.yahooapis.com/SiteExplorerService/V1/ping? sitemap=http://YOURDOMAIN/sitemap.xml" redirect = "no"> </cfhttp> <cfset YahooPingStatus = cfhttp.statusCode> <cfmail to = "you@gmail.com" from = "info@YOURDOMAIN" subject = "Multiple Site Map Ping Results" type = "html"> Ask: #AskPingStatus#<br/> Google: #GooglePingStatus#<br/> MSN: #MSNPingStatus#<br/> Yahoo: #YahooPingStatus#<br/> </cfmail> <cfcatch type="any"> <cfmail to = "you@gmail.com" from = "info@YOURDOMAIN" subject = "Multiple Site Map Ping Error" type = "html"> #cfcatch# </cfmail> </cfcatch> </cftry> |
This code can be run either when a sitemap is updated, or as a scheduled task. I prefer to ping the sitemap services when I create my feed.
Did you find this ColdFusion code useful? Let me know.








December 3rd, 2007 at 10:19 am
ahh, very clever use of coldfusion. as much as the big 4 claim to listen to your robots.txt file, they have allot of room to improve.
your readers may appreciate a quick refresher on the basics of creating a proper sitemap.xml file: http://blog.shofr.com/2007/development/seo-101-sitemaps/
December 5th, 2007 at 7:31 pm
have you the link for german language too? if yes - please post here.
December 6th, 2007 at 12:11 am
Hello Suchmaschinenoptimierung,
I believe the URL to ping Google is as follows:
http://www.google.de/webmasters/sitemaps/ping?sitemap=
http://YOURDOMAIN/sitemap.xml
As for the others I don’t, know but I can ask around for you.
December 26th, 2007 at 3:18 am
thanks for the info this can be very useful.
is this needed for google if you use the webmaster tools?
Can this be saved as a php file and after updating my sitemap I can just run the file from the browser?
Thanks!
February 4th, 2008 at 4:12 pm
You could use crawlscore.com to generate the sitemaps on a regular basis.
February 20th, 2008 at 4:06 pm
[...] engines when your sitemap changes. The process is know as pinging and the example is provided on Jason Bartholme’s SEO Blog. Worth a look as can be useful for prompting the search engines to come and crawl your site until [...]
June 2nd, 2008 at 2:28 am
Thanks for the Link Jason!