WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. starfishtrainers
    Member
    Posted 12 months 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
    Member
    Posted 6 months 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');
    }

Reply

You must log in to post.

About this Topic