Make WordPress Core

Opened 5 months ago

Closed 5 months ago

#60160 closed feature request (duplicate)

add_filter() for get_sitemap_url() function

Reported by: letraceursnork's profile letraceursnork Owned by:
Milestone: Priority: normal
Severity: normal Version: 6.4.2
Component: Sitemaps Keywords:
Focuses: Cc:


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()

Change History (1)

#1 @swissspidy
5 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

This sounds more like an enhancement request for Yoast SEO. Enhancements to get_sitemap_url, such as a filter, are already being tracked in #51211

Note: See TracTickets for help on using tickets.