Created
April 28, 2015 08:21
-
-
Save schilke/e0bb2b7da64c18e663eb to your computer and use it in GitHub Desktop.
Remove Date/Time information from Postinfo to avoid showing up in SERPs
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
<?php | |
/**************************************************************************************************************** | |
* ATTENTION! Don't copy the above line if you're going to use this in your functions.php - just the code below * | |
****************************************************************************************************************/ | |
function jsc_remove_modified_date(){ | |
if( is_page() ){ | |
add_filter( 'the_time', '__return_false' ); | |
add_filter( 'the_modified_time', '__return_false' ); | |
add_filter( 'get_the_modified_time', '__return_false' ); | |
add_filter( 'the_date', '__return_false' ); | |
add_filter( 'the_modified_date', '__return_false' ); | |
add_filter( 'get_the_modified_date', '__return_false' ); | |
} | |
} | |
add_action( 'template_redirect', 'jsc_remove_modified_date' ); | |
/**************************************************************************************************************** | |
* ATTENTION! Don't copy the below line if you're going to use this in your functions.php - just the code above * | |
****************************************************************************************************************/ | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment