[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 13 posts - 16 through 28 (of 28 total)
  • Author
    Posts
  • #685223
    Tom
    Lead Developer
    Lead Developer

    Can you show me a post where the date has disappeared?

    #685321
    Mohit
    #685486
    Tom
    Lead Developer
    Lead Developer

    Add this CSS:

    .page-hero time.updated {
        display: inline-block;
    }
    #686632
    Mohit

    Hey Tom,

    Thanks it’s working

    #687014
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

    #689036
    Mohit

    Hi Tom,

    On applying the code that you shared I found that the date from the google snippet removed for updated posts. How can I show updated date in google search?

    #689073
    Tom
    Lead Developer
    Lead Developer

    I’m not sure I understand. What code removed the updated date?

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

    this code OR:

    .page-hero time.updated {
        display: inline-block;
    }

    I am not sure which one but either of these

    #689091
    Tom
    Lead Developer
    Lead Developer

    Neither of those will remove the updated date.

    The first snippet will show the updated date if it exists. If not, it will show the published date.

    The second snippet simply shows the updated date HTML if necessary.

    Here’s what I’m seeing on the post you linked to above: https://www.screencast.com/t/mOK8iCHeL

    #689708
    Mohit

    Hey Tom,

    Look at the screenshots I took after updating the posts and neither of them shows the updated date in google snippet:

    https://prnt.sc/l0cea4
    http://prntscr.com/l0cer5 and others

    However, the posts I haven’t updated shows the date in Google snippet:

    http://prntscr.com/l0cf5j and all other posts.

    What could be the reason for this? And how can I fix this?

    Thanks

    #690097
    Tom
    Lead Developer
    Lead Developer

    Nothing Google related is instant. It can take them weeks to update the dates.

    As long as you’re displaying the updated date with the necessary schema, you’re doing all you can. The rest is up to Google.

    https://webmasters.stackexchange.com/questions/78588/when-does-google-use-article-published-date-vs-article-modified-date-in-serp
    https://webmasters.stackexchange.com/questions/59559/how-to-tell-how-old-a-page-is/59566#59566

    #690440
    Mohit

    Hi Tom,

    Yeah, I know nothing is instant with google but the screenshot I have sent (https://prnt.sc/l0cea4, http://prntscr.com/l0cer5) are for the posts that have been recrawled by Google after applying the code of the last update that you shared. And on recrawling the date disappeared on google snippet which was displaying before applying the code. I want to display the last updated date on google snippet just like this website:
    Google Snippet: https://prnt.sc/l0qyqt
    Actual Post: http://prntscr.com/l0qzj7

    As you can see from the above screenshots the google snippet date is Sept 5, 2018, however, the actual post date is July 30, 2017.

    Thanks

    #690881
    Tom
    Lead Developer
    Lead Developer

    Hmm, I’m afraid I don’t really have an answer. The required text and schema exists and is visible.

    It may be worth installing a plugin like this to see if it changes anything: https://wordpress.org/plugins/wp-structuring-markup/

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