Created
July 5, 2017 16:11
-
-
Save robbens/244bfe69aff167144e028e031814434c to your computer and use it in GitHub Desktop.
Add "Disallow: *.pdf" in robots.txt programmatically in WordPress
This file contains 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
/** | |
* Disallow pdfs in robots.txt | |
*/ | |
add_filter( 'robots_txt', function( $output, $public ) { | |
$output .= "Disallow: *.pdf\n"; | |
return $output; | |
}, 0, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment