Hi,
for removing the date stamps in SERP in search engines like Google completely I added the following code to functions.php:
function jl_remove_post_dates() {
add_filter('the_date', '__return_false');
add_filter('the_time', '__return_false');
add_filter('the_modified_date', '__return_false');
add_filter('get_the_date', '__return_false');
add_filter('get_the_time', '__return_false');
add_filter('get_the_modified_date', '__return_false');
} add_action('loop_start', 'jl_remove_post_dates');
Unfortunately this is removing all visible dates in magazine elements, latest news, single post etc. But what I want to achieve is to remove the dates of posts in SERP only.
I read that it could be helpful to remove the word “published” in time classes of functions.php for not showing up a date in SERP (but “updated” should not be removed). But I am not quite sure.
What do you think? Do you have an idea how to remove (without a plugin or similar)? Would be great!
Thank you and best regards,
Sophie
Hey Sophie,
Have you tried using a plugin such as this one – https://wordpress.org/plugins/wp-meta-and-date-remover/?
Best regards,
Yigit
Hi Yigit,
thank you for your reply. I thought I could solve this without using any plugin. Do you have any idea?
Thank you and best regards,
Sophie
Hi,
That would require a lot of custom code, which we cant provide it…
Best regards,
Basilis
Hi Basilis,
thank you for the update. That’s too bad :-( . You can close this topic now.
Best regards,
Sophie