Hallo Leute,
Ich habe bei meinem Blog die robots.txt Datei während 2 Jahren aktiviert. Damit sie nicht indexiert wird.
Jetzt möchte ich die Website öffentlich machen und habe die robots.txt deaktiviert.
Trotzdem ist aber die robots in der functions.php immer noch vorhanden.
Was muss ich am Code ändern, damit Google & Co nicht geblockt wird:
Besten Dank für eure Hilfe
}
/**
* Display the robots.txt file content.
*
* The echo content should be with usage of the permalinks or for creating the
* robots.txt file.
*
* @since 2.1.0
*/
function do_robots() {
header( 'Content-Type: text/plain; charset=utf-8' );
/**
* Fires when displaying the robots.txt file.
*
* @since 2.1.0
*/
do_action( 'do_robotstxt' );
$output = "User-agent: *\n";
$public = get_option( 'blog_public' );
if ( '0' == $public ) {
$output .= "Disallow: /\n";
} else {
$site_url = parse_url( site_url() );
$path = ( !empty( $site_url['path'] ) ) ? $site_url['path'] : '';
$output .= "Disallow: $path/wp-admin/\n";
}
/**
* Filter the robots.txt output.
*
* @since 3.0.0
*
* Param string $output Robots.txt output.
* Param bool $public Whether the site is considered "public".
*/
echo apply_filters( 'robots_txt', $output, $public );
}