Skip to content

Instantly share code, notes, and snippets.

@kingkool68
Last active December 24, 2015 08:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kingkool68/6771010 to your computer and use it in GitHub Desktop.
Save kingkool68/6771010 to your computer and use it in GitHub Desktop.
Add sitemap links to your robots.txt file using the BWP Google Sitemap Plugin for WordPress.
//BWP Google Sitemap Plugin doesn't add sitemap links to robots.txt files so I guess I'll do it myself...
function pew_add_sitemap_urls_to_robots_txt() {
echo "\nSitemap: " . get_site_url() . "/sitemap.xml";
echo "\nSitemap: " . get_site_url() . "/post_google_news.xml";
echo "\n\n";
return $txt;
}
add_action( 'do_robotstxt', 'pew_add_sitemap_urls_to_robots_txt' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment