[wp-trac] [WordPress Trac] #50456: Multisite robots.txt files should reference all network XML sitemaps

WordPress Trac noreply at wordpress.org
Wed Jun 24 01:42:56 UTC 2020


#50456: Multisite robots.txt files should reference all network XML sitemaps
----------------------------+------------------------------
 Reporter:  jonoaldersonwp  |       Owner:  (none)
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Sitemaps        |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  seo             |     Focuses:  multisite
----------------------------+------------------------------

Comment (by pbiron):

 Here's a couple of other complications (i.e., when I said I have a
 "working patch", it isn't 100% working):

 1. sitemaps have to be enabled on the main site, and that may not be the
 case even when they are enabled on sub-sites
    * we might be able to around that problem hooking
 `WP_Sitemaps::add_robots()` in multisite  even when sitemaps are disabled
 on the main site (haven't tried that yet, but I think it should work)
 2. even when a sub-site is `public` (and not `archived`, `deleted` or
 `spam`) sitemaps may be disabled on that sub-site by a plugin...and there
 is no way to (reliably) know that from the main site
    * `switch_to_blog()` does **not** load plugins for that specific sub-
 site (and even if it did, they would remain active for the remainder the
 sites being iterated through; e.g., if sub-site 8 had a plugin that
 disabled sitemaps and it was loaded to test whether to output the sitemap
 reference in `robots.txt`, then sitemaps would "appear" to be disabled for
 all sub-sites after that, even if no other sub-site had a plugin that
 disabled them :-(

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50456#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list