[wp-trac] [WordPress Trac] #51211: Implement a consistent function to obtain the sitemap location

WordPress Trac noreply at wordpress.org
Thu Sep 10 00:44:01 UTC 2020

#51211: Implement a consistent function to obtain the sitemap location
 Reporter:  GreatBlakes  |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Sitemaps     |     Version:  5.5.1
 Severity:  trivial      |  Resolution:
 Keywords:  has-patch    |     Focuses:

Comment (by GreatBlakes):

 I have a theme that I use for all of my clients' websites and it does a
 few things with the sitemap file ''(disregarding the fact that it is
 probably better suited to plugin functionality)'':

 First thing is that it does add a metabox to the Dashboard where, among
 other convenient links, is the active sitemap XML file URL so it can
 easily be copied to add to tools like Google Search Console. The other
 thing it does is runs automatic checks to make sure that ''a'' sitemap is
 active– this makes it obvious to me or other admins if something got
 inadvertently changed or deactivated without needing to actively look for
 it. I'm sure there are other tools for that (or possibly even
 unnecessary), but it's one of those peace-of-mind type features to me.

 Before, I'd just install Yoast on all the sites and I could have both of
 these features check Yoast's known sitemap file/location specifically, but
 I'd rather be agnostic to any sitemap plugin or core that my clients want
 to use.

 I suppose I could make a server-side request to the robots.txt file, parse
 it, then check the response of the sitemap XML file, but my thought here
 was that if we had a filter, any plugin that is overriding the WordPress
 core sitemap file could utilize that filter to confirm not only that their
 sitemap is active, but also their specific filename/location (since there
 is a wide variety of filenames).

 I hope that helps clarify my use case.

 From an entirely nit-picky and semantic point-of-view, it could be
 misleading if a plugin is overriding the WordPress core sitemap XML, but a
 developer calling {{{get_sitemap_url('index')}}} would get a returned
 value that technically is not correct. However, I can't say how often (or
 if) that hypothetical situation would ever happen.

 I do want to thank you all for your time and indulging me in this feature
 request regardless of the outcome.

Ticket URL: <https://core.trac.wordpress.org/ticket/51211#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list