I have written a PHP script that creates my sitemap.xml file using the information from my mysql database but I am stuck submitting it to google manually each day. I would like to code into my script to ping Google to let it know that the sitemap has been updated after the script runs. How can I ping Google using PHP?
Once your sitemap is created, by whatever means, you can notify Google using any of the following methods:
1. Resubmitting a Sitemap using Google Webmaster Tools
Log into Google Webmaster Tools located at https://www.google.com/webmasters/tools/ and then click on the site that you would like to submit the sitemap for. To the right of the screen under Sitemaps clcik on the link for your sitemap. Once on the Sitemaps page click Resubmit.
2. Resubmitting via sending Google an HTTP request
Request this url www.google.com/webmasters/tools/ping?sitemap=SITEMAP_URL