mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Disallow indexing wp-admin and wp-includes in robots.txt. Props SergeyBiryukov. fixes #18465
git-svn-id: https://develop.svn.wordpress.org/trunk@18822 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8e77c91883
commit
25df5fe335
@ -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
Block a user