How can I remove date time stamp from entire theme? I don’t want Google to show date in its search result.
I tried following code in functions.php:
/* Start of Remove Date TimeStamp from blog posts */
function remove_post_dates() {
add_filter(‘the_time’, ‘__return_false’);
add_filter(‘get_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(‘get_the_date’, ‘__return_false’);
add_filter(‘the_modified_date’, ‘__return_false’);
add_filter(‘get_the_modified_date’, ‘__return_false’);
add_filter(‘get_comment_date’, ‘__return_false’);
add_filter(‘get_comment_time’, ‘__return_false’);
}
add_action(‘loop_start’, ‘remove_post_dates’);
/* End of Remove Date TimeStamp from blog posts */
However, it resulted in weird Jan 1, 1970 date in Google search snippet as shown in below screenshot:
I want to remove date time stamp as shown below screenshot:
http://www.wpsquare.com/wp-content/uploads/2012/07/remove-date-timestamp-google-search-results.png
Please help.
Google may be taking it from your feed or sitemap or comments probably :/
You’re using WP SEO plugin. In titles and meta settings, uncheck the box that says “dates in snippet previews” and you’ll be good to go.
