Title: Programatically adding URLs to XML sitemap
Last modified: August 1, 2022

---

# Programatically adding URLs to XML sitemap

 *  Resolved [cknowles](https://wordpress.org/support/users/cknowles/)
 * (@cknowles)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/programatically-adding-urls-to-xml-sitemap/)
 * Hi there,
 * I have a need to add a number of URLs to the AIOSEO generated sitemap for a site
   I’m working on. These are valid URLs on the site the sitemap is for, however,
   they are not of a post type, and instead use a custom URL rewriting scheme, developed
   using add_rewrite rule, and get_query_var. I can generate a list of said URLs,
   I can supply priority, frequency, and last updated values for each URL, I just
   can’t figure out how to inject these into the AIOSEO sitemap.
 * The CSV import option suggested in the docs is not feasible here, as I need it
   to be dynamic.
 * Any help that could be provided would be greatly appreciated, thanks!

Viewing 1 replies (of 1 total)

 *  Thread Starter [cknowles](https://wordpress.org/support/users/cknowles/)
 * (@cknowles)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/programatically-adding-urls-to-xml-sitemap/#post-15877949)
 * EDIT: I think I may have found the solution, in the aioseo_sitemap_indexes filter(
   and a custom page in which I list the additional pages in a valid format). I’m
   going to leave this unresolved until I’ve had a play around with it, in case 
   someone can suggest a better solution.
 * EDIT AGAIN: This seems to do what I need it to. Marking as resolved.

Viewing 1 replies (of 1 total)

The topic ‘Programatically adding URLs to XML sitemap’ is closed to new replies.

 * ![](https://ps.w.org/all-in-one-seo-pack/assets/icon.svg?rev=2443290)
 * [All in One SEO – Powerful SEO Plugin to Boost SEO Rankings & Increase Traffic](https://wordpress.org/plugins/all-in-one-seo-pack/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/all-in-one-seo-pack/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/all-in-one-seo-pack/)
 * [Active Topics](https://wordpress.org/support/plugin/all-in-one-seo-pack/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/all-in-one-seo-pack/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/all-in-one-seo-pack/reviews/)

## Tags

 * [sitemap](https://wordpress.org/support/topic-tag/sitemap/)

 * 1 reply
 * 1 participant
 * Last reply from: [cknowles](https://wordpress.org/support/users/cknowles/)
 * Last activity: [3 years, 10 months ago](https://wordpress.org/support/topic/programatically-adding-urls-to-xml-sitemap/#post-15877949)
 * Status: resolved