Created
July 31, 2017 11:40
-
-
Save shangdev/42ed2973cfe7a949172ed1919580de55 to your computer and use it in GitHub Desktop.
wordpress, robots.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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