Selecteer een pagina

Met de volgende code kan je WordPress sitemap in je robot.txt toevoegen. Plaats dit in je functions.php in je child theme.

Credits Yoast SEO

/**
* Add Yoast SEO sitemap to virtual robots.txt file network wide
* https://wphelper.site/robots-txt-yoast-sitemap-multisite/
*/
function milimedia_robotstxt_function( $output, $public ) {
$homeURL = get_home_url();

$output .= "Sitemap: $homeURL/sitemap_index.xml\n";

return $output;
}
add_filter( 'robots_txt', 'milimedia_robotstxt_function', 20, 2 );