Skip to content

Instantly share code, notes, and snippets.

@Lego2012
Last active August 21, 2020 23:54
Show Gist options
  • Save Lego2012/8a2114ab726cb803fe3941fc33403f75 to your computer and use it in GitHub Desktop.
Save Lego2012/8a2114ab726cb803fe3941fc33403f75 to your computer and use it in GitHub Desktop.
The following task will run after the build task, it will send a request to Google and Bing, informing them that the site has been updated and that they should re-index the site. #gulp
var gulp = require('gulp'),
request = require('request');
gulp.task('seo', ['build'], function(cb) {
request('http://www.google.com/webmasters/tools/ping?sitemap={URL TO YOUR SITEMAP.XML}');
request('http://www.bing.com/webmaster/ping.aspx?siteMap={URL TO YOUR SITEMAP.XML}');
cb();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment