Yoast / wordpress-seo

Yoast SEO for WordPress
https://yoast.com/wordpress/plugins/seo/
Other
1.76k stars 886 forks source link

Multisite: multiple sitemaps in each robots.txt #18584

Open castelar opened 2 years ago

castelar commented 2 years ago

Please give us a description of what happened.

Many sitemaps are being referenced in robots.txt on multisite network.

Please describe what you expected to happen and why.

There should only be one sitemap in each robots file.

How can we reproduce this behavior?

  1. Activate Yoast on two or more sites on multisite network and enable XML Sitemaps for each
  2. Check each site's robots.txt

Used versions

nprovoost commented 2 years ago

whats the status on this ?

bjorn2404 commented 1 year ago

Noting this can be addressed with the wpseo_should_add_subdirectory_multisite_xml_sitemaps filter. For example:

add_filter( 'wpseo_should_add_subdirectory_multisite_xml_sitemaps', '__return_false' );

It might be better to have the default functionality flipped though, with all sitemaps included if a setting is enabled.