Site logo

Archived topic

How to remove post date from google snippet

27 replies · Started by Mohit on September 21, 2018

Viewing posts 1–15 of 28

Hey,
I wanted to know how can I remove date from google snippet? https://prnt.sc/kx0syu for your reference!

Thanks

Hi there,

that looks like it is coming from a plugin. Are you using Yoast?

Hey David,

Yes I am using yoast seo plugin but have disabled date from that a month ago but still getting the dates in google snippet!
Is there is a way to hide date from snippet?

That's the microdata working. Would you like to remove the published/updated date microdata?

Hey Tom,

Just a quick question, if I remove the published date microdata will I be getting error in search console?

I just want to hide the date from the search snippet from the google result.

Thanks

Hey Mohit, you can easily do this by using the "WP Date Remover" plugin. I was using it on my site http://10bestranked.com but now I simply have my "Updated" date as I think Google loves this more (as you update your post it'll change the date). I have someone custom code this for me. If you want, I can send you the code for it. I was using GeneratePress there, but now use it on another site.

Hi Isaac,
Even I am now looking to change published date to last updated as its good in the eyes of google, can You please tell me what changes did you do to achieve that and how are you keeping your post updated? Are you using some plugin or are you actually updated the posts as I can see you have plenty of revised posts!

Thanks

Google will likely be looking for a published date, so you might get an "error" in your search console if it doesn't exist.

Hi Tom,
If I don’t remove publish date to last updated then there won’t be any error, right? If then can you please tell me the code to change the published date to last updated? Just like: http://10bestranked.com/ Did?
PS: I am using Page hero to show date. My page url: http://www.techtechnik.com

Thanks

Give this a shot:

add_filter( 'generate_page_hero_post_date', function() {
    $time_string = '<time class="entry-date published" datetime="%1$s" itemprop="datePublished">%2$s</time>';

    if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
        $time_string = '<time class="updated" datetime="%3$s" itemprop="dateModified">%4$s</time>';
    }

    $time_string = sprintf( $time_string,
        esc_attr( get_the_date( 'c' ) ),
        esc_html( get_the_date() ),
        esc_attr( get_the_modified_date( 'c' ) ),
        esc_html( get_the_modified_date() )
    );

    return $time_string;
} );

Looks good to me. Right now it's showing the published date, so I'm assuming the post hasn't been updated.

Hey,
But I have already applied the code that you shared!

And what about it isn't working? Has that post been updated?

Nope, its not working and publish date goes missing when i update the article

This archived topic is closed to new replies.