[wp-trac] [WordPress Trac] #60160: add_filter() for get_sitemap_url() function
WordPress Trac
noreply at wordpress.org
Thu Dec 28 08:11:54 UTC 2023
#60160: add_filter() for get_sitemap_url() function
-----------------------------+-----------------------------
Reporter: letraceursnork | Owner: (none)
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Sitemaps | Version: 6.4.2
Severity: normal | Keywords:
Focuses: |
-----------------------------+-----------------------------
I'm facing an issue retrieving the link to the sitemap generated by a
third-party plugin (in my case it's Yoast SEO). The plugin generates a
sitemap on a separate route and adds a 301 redirect rule from the URL /wp-
sitemap.xml to its own route (at the time of writing it's
/sitemap_index.xml). However, there is no native way (including within the
plugin itself) to obtain the correct link to the sitemap with a status
code of 200. Of course, one can continue to access /wp-sitemap.xml, but in
reality, this page responds with a 301 code, which could adversely affect
SEO.
Suggestion: Add a filter hook, such as 'hook_example_sitemap_url,' which
would be applied to the return function of get_sitemap_url()
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60160>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list