Besides the urls of posts, pages and categories, I need my site’s sitemap to include the urls of various pages that display data coming from an external source other than the WP database (Rails API).
Is there a hook to which I can add a filter so that once Dynamic Sitemap Generation takes place, I can then append these other urls to the sitemap.
PS: I had a suggestion to use aiosp_sitemap_post_filter, but there is no doc on how it works.
Thanks
UPDATE
with aiosp_sitemap_post_filter you can add only other posts to the sitemap and no custom content.
This is the solution from Peter Baylies (Plugin Author)
This is not a solution to my question but it helps me to solve my problem in WordPress, and I want to share it.
I create a separate sitemap using XMLWriter. Here is the code.
WordPress hook:
EventsSitemapBuilder():
Also it turns out that
option_aioseop_options
hook fires on any page load (and even multiple times). I’ve added few lines of code to Pietro’s solution to check if sitemap.xml is requested: