Skip to content

Instantly share code, notes, and snippets.

@shangdev
Last active July 31, 2017 11:41
Show Gist options
  • Save shangdev/7bb00fdd1fe6d0fc66323b5335870df8 to your computer and use it in GitHub Desktop.
Save shangdev/7bb00fdd1fe6d0fc66323b5335870df8 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: /\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