[Support request] Not showing Last Update Date in google search page

Home Forums Support Not showing Last Update Date in google search page

  • This topic has 5 replies, 3 voices, and was last updated 12 months ago by David.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #1026261


    I am using Last update date for my posts. It works well in my site.

    but in google search page still showing publish date.

    Please help me to show the update date in search result.


    Customer Support

    Hi there,

    By default both the published date and updated date are in the markup – Google decides what to read.

    You can try only showing the updated date in the markup using this PHP snippet:

    Adding PHP: https://docs.generatepress.com/article/adding-php/


    Applied below codes. But still showing published date in google structured data testing tool.

    Could you check, please?

    add_filter( 'generate_post_date_output', function( $output, $time_string ) {
        $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="entry-date updated-date" datetime="%3$s" itemprop="dateModified">Last Updated: %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 sprintf( '<span class="posted-on">%s</span> ',
    }, 10, 2 );
    Customer Support

    How are you adding the code?


    By Code Snippets plugin.

    Check this screenshot – https://prnt.sc/pexb46

    Customer Support

    Hi there,

    the snippet worked and the date that GP outputs is now only displaying the Updated Date.

    Google may be picking up the dates from the head meta tags your SEO plugin is adding. Or it may just be its algorithms dictate the published date as more relevant. Generally, given time and re-crawls, it will pick up the date that is displayed on the page. But we can’t control that.

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