We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b226691 commit 9687905Copy full SHA for 9687905
1 file changed
src/wp-includes/functions.php
@@ -1718,10 +1718,8 @@ function do_robots() {
1718
$output = "User-agent: *\n";
1719
$public = (bool) get_option( 'blog_public' );
1720
1721
- $site_url = parse_url( site_url() );
1722
- $path = ( ! empty( $site_url['path'] ) ) ? $site_url['path'] : '';
1723
- $output .= "Disallow: $path/wp-admin/\n";
1724
- $output .= "Allow: $path/wp-admin/admin-ajax.php\n";
+ $output .= 'Disallow: ' . (string) wp_parse_url( admin_url(), PHP_URL_PATH ) . "\n";
+ $output .= 'Allow: ' . (string) wp_parse_url( admin_url( 'admin-ajax.php' ), PHP_URL_PATH ) . "\n";
1725
1726
/**
1727
* Filters the robots.txt output.
0 commit comments