OK – never mind. This worked fine. I just needed to disable and re-enable XML sitemaps to get the plugin to rebuild the sitemap with my new additions.
As you were…
Had a similar problem a while ago.
If the filter only gets called after a toggle of checkbox, I would consider it a bug in Yoast SEO.
Well, after I thought about it, it would seem it would be a bit of a waste on the server to rebuild the sitemap index with every single request. I’m guessing the rebuild is only triggered when additions (or deletions) are made to the site. My shortcut was to turn the sitemaps off and back on.
It becomes a problem if you want to add/remove/change date/etc. of custom sitemap entries via this filter. These changes are not reflected until a manual toggle of checkbox in backend and/or other conditions (don’t know which these are).
Hi Ov3rfly,
If you still believe you have a bug, you can file a bug report for the Yoast SEO plugin in the following GitHub repository: https://github.com/Yoast/wordpress-seo
~ Kim ~
Support at Yoast
@askkim: Not worth it. As an example this bug which I found has been posted to github by someone many months ago and is still not fixed.
Seems too much energy goes into moving features from the free to the premium version, so no time to fix all the bugs.
Feel free to file a bug report and/or better docs request about the sitemap filter, it is pretty obvious that a filter for third party code should be called not only after a checkbox toggle in backend. If it is also called under other conditions, these should be added to docs.