XML Sitemap & Google News feeds
[resolved] Custom Post Types support thrugh "constants" (4 posts)

  1. crosa
    Posted 3 years ago #

    We've updated the plugin to the latest version (3.9.2), yet content using our Custom Post Types are still not showing up in the feed... only Posts are showing up. If CPT's are not supported automatically, what constants need to be added / changed and where? I was unable to find any documentation.

    Site is:



  2. RavanH
    Plugin Author

    Posted 3 years ago #


    Please update to the development version http://downloads.wordpress.org/plugin/xml-sitemap-feed.zip (download, unzip and upload via FTP; or uninstall the current version and install the zip via the WP back-end)

    Let me know ho it works out :)

  3. crosa
    Posted 3 years ago #

    Hi RavanH:

    Thanks for following up. I will definitely take a look.

    We were able to put in a workaround last week, which looks similar to what you are doing in the dev version. The edit was in xml-sitemap-feed/xml-sitemap.php , and I changed the XMLSF_NEWS_POST_TYPE from 'post' to 'any' as follows:

    if ( !defined('XMLSF_MEMORY_LIMIT') )
    define('XMLSF_MEMORY_LIMIT', '256M');

    if ( !defined('XMLSF_POST_TYPE') )
    define('XMLSF_POST_TYPE', 'any');

    if ( !defined('XMLSF_NEWS_POST_TYPE') )
    define('XMLSF_NEWS_POST_TYPE', 'any');

    if ( !defined('XMLSF_NAME') )
    define('XMLSF_NAME', 'sitemap.xml');

    if ( !defined('XMLSF_NEWS_NAME') )
    define('XMLSF_NEWS_NAME', 'sitemap-news.xml');

    After making the change, an /audio custom post type story indexed for the first time, so I think we're good for now.

  4. RavanH
    Plugin Author

    Posted 3 years ago #

    You can define these constants in wp-config.php so you would not have to modify the plugin. But seeing these constants will be replaced by back-end options in the next release, you might as well stick with your method for now :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic