Title: YoastSEO
Last modified: February 24, 2020

---

# YoastSEO

 *  Resolved [stephose](https://wordpress.org/support/users/stephose/)
 * (@stephose)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/yoastseo-4/)
 * I have 12 XML Sitemap listed in hostname.com/sitemap_index.xml.
    How can I edit
   these files? Some old pages listed I want to remove.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [stephose](https://wordpress.org/support/users/stephose/)
 * (@stephose)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/yoastseo-4/#post-12478930)
 * This was useful. Thanks. It allows for edits of pages/posts within WordPress 
   to be removed from sitemap XML’s. If the pages and posts do not exist in WordPress
 * 1)I should use
 * add_filter( ‘wpseo_exclude_from_sitemap_by_post_ids’, function () {
    return array(
   311, 322 ); } ); ?
 * 2) In what PHP program should these filters live?
 * I have 12 sitemap XML’s is their an easier way to edit them?
 * Thanks
 *  Thread Starter [stephose](https://wordpress.org/support/users/stephose/)
 * (@stephose)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/yoastseo-4/#post-12479060)
 * The functions.php file can be found in my theme and three versions under wordpress-
   seo , so I am not sure which to use?
 *  [devnihil](https://wordpress.org/support/users/devnihil/)
 * (@devnihil)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/yoastseo-4/#post-12483182)
 * [@stephose](https://wordpress.org/support/users/stephose/) You can control what
   content types are included in the sitemap in the settings located in the SEO>
   Search Appearance area. To customize what types of pages or content are included
   in the sitemap you would need to perform the following steps:
    -  In WordPress, go to SEO>Search Appearance
       Click on the appropriate tab to
      add or remove certain post types from the search results. Removing a post 
      type from the search results will also remove them from the sitemap. Click‘
      Save Changes.’
 * We also have additional information on configuring your XML Sitemap located at
   the following link: [https://kb.yoast.com/kb/how-to-customize-the-sitemap-index/](https://kb.yoast.com/kb/how-to-customize-the-sitemap-index/)
 * As for using the wpseo_exclude_from_sitemap_by_post_ids filter, you would want
   to add that your theme’s functions.php file.
 *  Thread Starter [stephose](https://wordpress.org/support/users/stephose/)
 * (@stephose)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/yoastseo-4/#post-12483899)
 * Thanks for that information. I consider call closed

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘YoastSEO’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-seo/assets/icon-256x256.gif?rev=3419908)
 * [Yoast SEO - Advanced SEO with real-time guidance and built-in AI](https://wordpress.org/plugins/wordpress-seo/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-seo/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-seo/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-seo/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-seo/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-seo/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [stephose](https://wordpress.org/support/users/stephose/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/yoastseo-4/#post-12483899)
 * Status: resolved