Title: [Plugin: Google XML Sitemaps] Feature/Fix: Custom Post Types
Last modified: August 20, 2016

---

# [Plugin: Google XML Sitemaps] Feature/Fix: Custom Post Types

 *  [Terrycy](https://wordpress.org/support/users/terrycy/)
 * (@terrycy)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-google-xml-sitemaps-featurefix-custom-post-types/)
 * Hello,
    First of all, great job on an excellent plugin!
 * I’ve recently installed it on a website that relies heavily on custom post types.
   After setup and checking the sitemap.xml, I’ve found that the plugin doesn’t 
   submit my custom post types, in order for it to work I have altered sitemap-core.
   php line 1169 from
 *     ```
       function GetCustomPostTypes() {
       		$post_types = get_post_types(array("public"=>1));
   
       		$post_types = array_diff($post_types,array("post","page","attachment"));
       		return $post_types;
       	}
       ```
   
 * to
 *     ```
       function GetCustomPostTypes() {
       		$post_types = get_post_types();
       		return $post_types;
       	}
       ```
   
 * after doing so, it displayed all post types (as you would expect having removed`
   array_diff` from the function). The resulting list was “Include custom post type
   Posts” repeated for each post type, as opposed to the actual post type name e.
   g. post_type_gallery.
 * In order to fix this, I have changed line 1088:
 *     ```
       <?php echo str_replace('%s',$post_type_object->label,__('Include custom post type %s', 'sitemap')); ?>
       ```
   
 * to
 *     ```
       <?php echo str_replace('%s',$post_type_object->name,__('Include custom post type %s', 'sitemap')); ?>
       ```
   
 * As I want to continue using the plugin and update it, would it be possible to
   update this feature of the plugin please?
 * Thanks
    Tez
 * [http://wordpress.org/extend/plugins/google-sitemap-generator/](http://wordpress.org/extend/plugins/google-sitemap-generator/)

The topic ‘[Plugin: Google XML Sitemaps] Feature/Fix: Custom Post Types’ is closed
to new replies.

 * ![](https://ps.w.org/google-sitemap-generator/assets/icon-256x256.png?rev=2713572)
 * [XML Sitemap Generator for Google](https://wordpress.org/plugins/google-sitemap-generator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/google-sitemap-generator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/google-sitemap-generator/)
 * [Active Topics](https://wordpress.org/support/plugin/google-sitemap-generator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/google-sitemap-generator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/google-sitemap-generator/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Terrycy](https://wordpress.org/support/users/terrycy/)
 * Last activity: [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-google-xml-sitemaps-featurefix-custom-post-types/)
 * Status: not a support question