Showing posts with label Google Webmasters. Show all posts
Showing posts with label Google Webmasters. Show all posts

Wednesday, 14 September 2016

Submit URL to Search Engines for Indexing

In order to generate organic traffic to our website, we need our site links to be indexed in search engines. For this, we need to make search engines crawl our URLs. This function helps in submitting our URLs and sitemap XML links to major search engines so that our links gets indexed easily. We need to pass the URL as a parameter for the function is all we need to do.


function submitUrl2SearchEngine($site_url) {
    // Eg: $site_url = http://www.demowebsite.com/sitemap.xml
    @file_get_contents("http://www.google.com/webmasters/sitemaps/ping?sitemap=$site_url");
    @file_get_contents("http://www.bing.com/webmaster/ping.aspx?siteMap=$site_url");
    @file_get_contents("http://search.yahooapis.com/SiteExplorerService/V1/updateNotification?appid=YahooDemo&url=$site_url");
    @file_get_contents("http://submissions.ask.com/ping?sitemap=$site_url");  
}