Disallow indexing wp-admin and wp-includes in robots.txt. Props SergeyBiryukov. fixes #18465
git-svn-id: http://svn.automattic.com/wordpress/trunk@18822 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
2edc82cd61
commit
44029b1ef1
|
@ -1846,14 +1846,15 @@ function do_robots() {
|
|||
|
||||
do_action( 'do_robotstxt' );
|
||||
|
||||
$output = '';
|
||||
$output = "User-agent: *\n";
|
||||
$public = get_option( 'blog_public' );
|
||||
if ( '0' == $public ) {
|
||||
$output .= "User-agent: *\n";
|
||||
$output .= "Disallow: /\n";
|
||||
} else {
|
||||
$output .= "User-agent: *\n";
|
||||
$output .= "Disallow:\n";
|
||||
$site_url = parse_url( site_url() );
|
||||
$path = ( !empty( $site_url['path'] ) ) ? $site_url['path'] : '';
|
||||
$output .= "Disallow: $path/wp-admin/\n";
|
||||
$output .= "Disallow: $path/wp-includes/\n";
|
||||
}
|
||||
|
||||
echo apply_filters('robots_txt', $output, $public);
|
||||
|
|
Loading…
Reference in New Issue