WP_Sitemaps_Index::get_index_url() WordPress Method

The WP_Sitemaps_Index::get_index_url() method is used to get the URL for the sitemap index.

WP_Sitemaps_Index::get_index_url() #

Builds the URL for the sitemap index.


Return

(string) The sitemap index URL.


Top ↑

Source

File: wp-includes/sitemaps/class-wp-sitemaps-index.php

	public function get_index_url() {
		global $wp_rewrite;

		if ( ! $wp_rewrite->using_permalinks() ) {
			return home_url( '/?sitemap=index' );
		}

		return home_url( '/wp-sitemap.xml' );
	}


Top ↑

Changelog

Changelog
VersionDescription
5.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.