WP_Sitemaps::add_robots( string $output, bool $is_public )
Adds the sitemap index to robots.txt.
Parameters
- $output
-
(Required) robots.txt output.
- $is_public
-
(Required) Whether the site is public.
Return
(string) The robots.txt output.
Source
File: wp-includes/sitemaps/class-wp-sitemaps.php
public function add_robots( $output, $is_public ) {
if ( $is_public ) {
$output .= "\nSitemap: " . esc_url( $this->index->get_index_url() ) . "\n";
}
return $output;
}
Changelog
Version | Description |
---|---|
5.5.0 | Introduced. |