• Has anyone used the function register_sitemap() to add a custom sitemap to the Yoast XML sitemap? I am a bit lost and looking for pointers on how to implement this call.

    I have 4 custom xml sitemaps, with “$name $function()” defined just fine, but I cannot figure out how to add as described in the class-sitemaps.php script in Yoast (near line 55).

    Sorry for the beginner question.

Viewing 1 replies (of 1 total)
  • Hello Starfishtrainers,

    This is the solution to your problem:

    add_action('init', 'enable_custom_sitemap');
    function enable_custom_sitemap(){
        global $wpseo_sitemaps;
        $wpseo_sitemaps->register_sitemap('the-type', 'the-type-callback');
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Adding my custom sitemape to sitemap XML in WordPress SEO by Yoast’ is closed to new replies.