Skip to content

Instantly share code, notes, and snippets.

@shangdev
Created July 31, 2017 11:40
Show Gist options
  • Save shangdev/42ed2973cfe7a949172ed1919580de55 to your computer and use it in GitHub Desktop.
Save shangdev/42ed2973cfe7a949172ed1919580de55 to your computer and use it in GitHub Desktop.
wordpress, robots.txt
/**
* robots.txt
*
* @param string $output The output of the robots.txt file
* @return string $public If the site is public facing
*/
function robots_mod( $output, $public ) {
$output .= "Disallow: /wp-includes/\n";
$output .= "Disallow: /wp-content/plugins/\n";
$output .= "Allow: /\n";
return $output;
}
add_filter( 'robots_txt', 'robots_mod', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment