WP_Sitemaps::add_robots( string $output, bool $is_public ): string

Adds the sitemap index to robots.txt.


Parameters

$output string Required
robots.txt output.
$is_public bool Required
Whether the site is public.

Top ↑

Return

string The robots.txt output.


Top ↑

Source

File: wp-includes/sitemaps/class-wp-sitemaps.php. View all references

public function add_robots( $output, $is_public ) {
	if ( $is_public ) {
		$output .= "\nSitemap: " . esc_url( $this->index->get_index_url() ) . "\n";
	}

	return $output;
}


Top ↑

Changelog

Changelog
Version Description
5.5.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.