Skip to content

Instantly share code, notes, and snippets.

@sebastienserre
Created October 26, 2018 09:54
Show Gist options
  • Save sebastienserre/b64de4e3213c796e55ee2df00bc884c9 to your computer and use it in GitHub Desktop.
Save sebastienserre/b64de4e3213c796e55ee2df00bc884c9 to your computer and use it in GitHub Desktop.
Example of code to add a dynamic url for sitemaps in WP multisite / Multidomain
add_filter( 'robots_txt', 'thfo_add_sitemaps');
function thfo_add_sitemaps( $output ){
$sitemap_url = 'sitemap: ' . get_bloginfo('url') . '/sitemap.xml';
$output .= $sitemap_url;
return $output;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment