Today I complete two easy tasks:

  • intercept the URL http://www.myblog.com/sitemap.xml to serve the sitemap (it will work only with WordPress on Apache and permalink active)
  • ping Google when something happens in WordPress (eg. a post changed)

The two modifications are very easy. The first is a matter to do a little parsing of request uri:

substr($_SERVER[‘REQUEST_URI’], strlen($_SERVER[‘REQUEST_URI’])-11) == ‘sitemap.xml’

and to add a checkbox in the options panel to enable this feature.

The second, ping Google, it’s easy too, but for sake of semplicity, I wrote it to work only on WordPress 2.7 (which has some new libraries).

Google can be pinged for a news sitemap calling:

http://www.google.com/webmasters/sitemaps/ping?sitemap=sitemapurl

and the call is made using wp_remote_get (a special function of WordPress).

The final version of sitemap: [download id=”12″]

My excuses for my bad english but it's the only way I have to communicate with you. Would you suggest a correction? Leave a comment, thank you!

2 Comments

jcrosby330 · June 14, 2012 at 2:18 am

Hello, I recently graduated with my Master’s in English at Middle Tennessee State University. I am setting up my website to display my portfolio and I am looking for examples of my editing skills. While working on my footer for my site I came across your plugin and user manual. I also see your apologies for your English. Would you be interested in my editing your manual, both for your benefit, and mine, if you will let me display the example on my site? My website is JenniferAnnCrosby.com.

khaled · July 21, 2009 at 1:25 pm

I have installed the plugin but whenever i click on the sitemap from settings it shows an error
Object not found
“Error 404”

pls provide me a solution.im very newby in wordpress.Thanks in advance.

Leave a Reply