wordpress 添加修改 robots.txt
// define the do_robots ---------------------------------------------------------------------
add_filter( 'robots_txt', 'add_robots_rewrite', 10, 2 );
function add_robots_rewrite( $output, $public ) {
$output = "User-agent: *\n";
$output .= "Disallow: /\n";
$output .= "Disallow: /admin/\n";
$output .= "Disallow: /search/\n\n";
$output .= "\nUser-agent: ia_archiver\n";
$output .= "Disallow: /";
return $output;
}