Adding my custom sitemape to sitemap XML in WordPress SEO by Yoast (2 posts)

  1. starfishtrainers
    Posted 3 years ago #

    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.

  2. nikoza
    Posted 2 years ago #

    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');

Topic Closed

This topic has been closed to new replies.

About this Topic