[Resolved] How to show the post Updated date in Google Search

Home Forums Support [Resolved] How to show the post Updated date in Google Search

Home Forums Support How to show the post Updated date in Google Search

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #1494219
    Abdul

    Right now when I update a post I am getting the updated date in the post but the same is not reflected in the google search results for that post

    can you please let me know how to display the updated date in Google search results too.

    #1494500
    Leo
    Staff
    Customer Support
    #1494613
    Abdul

    View post on imgur.com

    I have added the code using the code snippet. I Will check if it reflects in Google and post the update.

    #1494616
    Leo
    Staff
    Customer Support

    Sounds good.

    It should 🙂

    #1497651
    Abdul

    the updated page date is not displayed in the google search. Please check the post mentioned in the private information section which was updated on Oct 19 but the search result still shows as Oct 12.

    In the sitemap it shows updated on Oct 19

    #1497704
    Elvin
    Staff
    Customer Support

    Hi,

    You have to request Google to recrawl your site if you want your changes to reflect immediately.
    https://support.google.com/webmasters/answer/6065812?hl=en

    #1759418
    Belinda

    Hello,
    I wanted the same thing and I added add_filter( 'generate_post_date_show_updated_only', '__return_true' ); using the code snippets plugin.
    My question is, at the bottom, do I check “Run Snippet Everywhere” ?

    Will the above work for dates on both posts and pages?

    Many thanks!
    Belinda

    #1759469
    Leo
    Staff
    Customer Support

    My question is, at the bottom, do I check “Run Snippet Everywhere”?

    Yes 🙂

    Will the above work for dates on both posts and pages?

    By default, there isn’t a time stamp in the markup of static pages.

    #1765434
    Belinda

    Thank you Leo. Highly appreciate your quick response!
    Belinda

    #1766240
    Leo
    Staff
    Customer Support

    No problem 🙂

    #1829989
    Charbel

    Hello @Leo,

    I have already the following two filters in my functions.php.

    /***** Show the "Updated" Post Date in Header Element *****/
    function post_modified_date() {
        return get_the_modified_date();
    }
    add_shortcode( 'modified_date', 'post_modified_date' ); 
    /***** Display updated date for WPSP Posts *****/ 
    add_filter( 'wpsp_post_date_show_updated_only', '__return_true' );

    If I add the filter noted in this topic, then the Updated on text is gone from my articles/posts.

    /***** Show post updated date in Google Search  *****/
    add_filter( 'generate_post_date_show_updated_only', '__return_true' );

    Is it ok if I add the ‘Updated on‘ text to the filter as follows?

    /***** Show post updated date in Google Search  *****/
    add_filter( 'generate_post_date_show_updated_only', 'Updated on', '__return_true' );

    Here is my site for your reference: https://charbelnemnom.com

    Finally, which filter should I take out and which one should I keep, so can I show the post Updated date in Google Search, as well as, on my WPSP home page, Blog page, and articles?

    Thank You @Leo

    #1830297
    Elvin
    Staff
    Customer Support

    Hi Charbel,

    Is it ok if I add the ‘Updated on‘ text to the filter as follows?

    /***** Show post updated date in Google Search *****/
    add_filter( ‘generate_post_date_show_updated_only’, ‘Updated on’, ‘__return_true’ );

    No, that won’t work.

    Just add this –

    /***** Show post updated date in Google Search  *****/
    add_filter( 'generate_post_date_show_updated_only', '__return_true' );

    and add this CSS:

    time.entry-date.updated-date:before {
        content: "Updated on ";
    }
    #1830425
    Charbel

    Thank you @Elvin, much appreciated!

    So, I have added the following two filters to cover all posts/articles and WPSP Posts on the home page as follows:

    /***** Display updated date for WPSP Posts homepage *****/ 
    add_filter( 'wpsp_post_date_show_updated_only', '__return_true' );
    /***** Show post updated date in Google Search for Posts *****/
    add_filter( 'generate_post_date_show_updated_only', '__return_true' );

    Then, I have added the CSS you noted above and it works as expected. Thank You!!!

    https://charbelnemnom.com/author/charbel-nemnom/ and
    https://charbelnemnom.com/microsoft-teams-vs-zoom-how-to-determine-the-right-fit/

    However, I have removed the previous function below since it’s not needed anymore:

    /***** Show the "Updated" Post Date in Header Element *****/
    function post_modified_date() {
        return get_the_modified_date();
    }
    add_shortcode( 'modified_date', 'post_modified_date' );

    Could you please confirm?

    I would expect that Google search will pick up the updated date and show it once it crawls the articles, right?

    Many Thanks, @Elvin!

    #1830433
    Elvin
    Staff
    Customer Support

    I assume you’re using that shortcode snippet on your header element but I’m not sure.

    Try disabling it and see if something disappears.

    I would expect that Google search will pick up the updated date and show it once it crawls the articles, right?

    That should be the case on pages with updated dates because Google crawler bots will have no way of reading the published date because the only <time> tag that renders is the updated date.

    #1830437
    Charbel

    Thank You @Elvin!

    I have commented out/disabled that shortcode snippet for the header element and nothing gets disappeared. I will keep verifying.

    As for Google Search, yes, I am interested in getting the updated date for articles/posts to show up during a search. Because I update my articles regularly and I don’t see the updated showing when I perform a search.

    I believe we are all set for now.

    Thank You!

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