How to notify Google your sitemap has changed using C# (.NET)

Its hard to deny that Google is the most used search engine in the world. They've have been reports that 90% of all search engine traffic is handled by Google. When you've updated a page, Google recommends updating your site's Sitemap and notify Google that it has happened through the Webmaster Tools.

Change Management Systems (C.M.S.) such as Wordpress have tools that will autonotify Google when a page has been updated. If you have your own C.M.S. system like I do, the only way previously of notifying Google was to create the Sitemap, upload and then go into Webmaster Tool and Notifying Google mine has changed or just wait.

You can create a programme or add it to your own C.M.S. to notify Google that your sitemap has changed. You'll need to have uploaded your Sitemap first and then do the coding. Essentially, what you are doing it is calling :-

http://www.google.com/ping?sitemap

from C#. The C# code to call that line programmatically is :-

StreamReader inStream;
WebRequest webRequest;
WebResponse webresponse;

webRequest = WebRequest.Create("http://www.google.com/ping?sitemap=https://www.example.com/sitemap.xml");
webresponse = webRequest.GetResponse();
inStream = new StreamReader(webresponse.GetResponseStream());
string sString = inStream.ReadToEnd();
inStream.Close();

When you go into Webmaster tools, you should find that Google will have hopefully revisited your site and taking notice of it.

Bing has a whole library of functionality to update them of any changes, its a little bit more involved.

Tags - Google

Last Modified : June 2023


About... / Contact.. / Cookie...