[Support request] How to remove post date from google snippet

Home Forums Support [Support request] How to remove post date from google snippet

Home Forums Support How to remove post date from google snippet

Viewing 15 posts - 1 through 15 (of 28 total)
  • Author
    Posts
  • #682889
    Mohit

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

    Thanks

    #682959
    David
    Staff
    Customer Support

    Hi there,

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

    #683410
    Mohit

    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?

    #683457
    Tom
    Lead Developer
    Lead Developer

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

    #683460
    Mohit

    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

    #683468
    Isaac

    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.

    #683485
    Mohit

    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

    #683886
    Tom
    Lead Developer
    Lead Developer

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

    #684025
    Mohit

    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

    #684126
    Tom
    Lead Developer
    Lead Developer

    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;
    } );
    #684146
    Mohit

    Hey Tom,

    Can you check if the class of date of the post is same in http://www.techtechnik.com/how-to-download-music-from-spotify-for-free/ as in the code that you shared. As it will take time for google to crawl and reflect the necessary changes.

    Thanks

    #684444
    Tom
    Lead Developer
    Lead Developer

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

    #684585
    Mohit

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

    #684689
    Tom
    Lead Developer
    Lead Developer

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

    #684754
    Mohit

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

Viewing 15 posts - 1 through 15 (of 28 total)
  • You must be logged in to reply to this topic.