• Resolved stephose

    (@stephose)


    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

    (@stephose)

    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

    (@stephose)

    The functions.php file can be found in my theme and three versions under wordpress-seo , so I am not sure which to use?

    Plugin Support devnihil

    (@devnihil)

    @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/

    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

    (@stephose)

    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.