Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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