• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Yoast SEO a2z

Yoast SEO a2z

WordPress SEO a2z

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / WPSEO_Sitemaps::build_root_map() – Build the root sitemap (example.com/sitemap_index.xml) which lists sub-sitemaps for other content types.

You appear to be a bot. Output may be restricted

Description

Build the root sitemap (example.com/sitemap_index.xml) which lists sub-sitemaps for other content types.

Usage

WPSEO_Sitemaps::build_root_map();

Parameters

Returns

void

Source

File name: wordpress-seo/inc/sitemaps/class-sitemaps.php


Lines:

1 to 27 of 27
  public function build_root_map() {

    $links            = [];
    $entries_per_page = $this->get_entries_per_page();

    foreach ( $this->providers as $provider ) {
      $links = array_merge( $links, $provider->get_index_links( $entries_per_page ) );
    }

    
/**
 * Filter the sitemap links array before the index sitemap is built.
 *
 * @param array  $links Array of sitemap links
 */
    $links = apply_filters( 'wpseo_sitemap_index_links', $links );

    if ( empty( $links ) ) {
      $this->bad_sitemap = true;
      $this->sitemap     = '';

      return;
    }

    $this->sitemap = $this->renderer->get_index( $links );
  }
 

 View on GitHub View on Trac

Published: 27th November 2019 | Last updated: 10th December 2020

Primary Sidebar

Information

Function name: WPSEO_Sitemaps::build_root_map
Class ref: WPSEO_Sitemaps
Plugin ref: Yoast SEO
Version: 15.4
Sourcefile: inc/sitemaps/class-sitemaps.php
File ref: inc/sitemaps/class-sitemaps.php
Deprecated?: No
API Letters: B,M,R,S,W

Footer

Yoast SEO a2z
Yoast SEO a2z
WordPress SEO a2z
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  wordpress-seo.wp-a2z.org
© Copyright Yoast SEO a2z 2017-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites