• How can make the search engine pick the last modified data instead of the upload date?

    Is there a way to hide the upload date and only show up the last modified date?

    Also, how can I enable the last modified date?

    Thanks

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter umairee95

    (@umairee95)

    Okay so I checked the “Structured Data Markup” option in the advanced settings. Now I see the published data as well as updated date.

    My question is: what date will search engines pick up? If they pick up the published date, is there a way to hide the published data so they pick up updated date?

    Irene

    (@arlinaite)

    Hi,

    I have the same issue, because Google takes the published date, for the SERPs.

    How did you manage to show only the update date?

    Anyhow there is something weird:
    The page that you use as example has a modified date: (Last updated on February 7th, 2019)
    But in the SERPs I have seen 19 feb. 2019 – for the same page.

    Irene

    (@arlinaite)

    Thanks, I fixed it.

    For somebody else with the same issue:

    • From hueman/parts folder copy the file single-author-date.php
    • Then edit the file deleting all the content.
    • Paste the file in the folder parts of your hueman child theme.
    • Use the plugin code snippets and paste the following code:

    If your site is in English:

    function wpb_last_updated_date( $content ) {
    $u_time = get_the_time('U'); 
    $u_modified_time = get_the_modified_time('U'); 
    if ($u_modified_time >= $u_time + 86400) { 
    $updated_date = get_the_modified_time('F jS, Y');
    $updated_time = get_the_modified_time('h:i a'); 
    $custom_content .= '<p class="last-updated">Last updated on '. $updated_date . ' at '. $updated_time .'</p>';  
    } 
     
        $custom_content .= $content;
        return $custom_content;
    }
    add_filter( 'the_content', 'wpb_last_updated_date' );

    if your site is in Spanish:

    function wpb_last_updated_date( $content ) {
    $u_time = get_the_time('U'); 
    $u_modified_time = get_the_modified_time('U'); 
    if ($u_modified_time >= $u_time + 86400) { 
    $updated_date = get_the_modified_time('j \d\e\ F \d\e\ Y \|\ g:i a ');
    $updated_time = get_the_modified_time('h:i a'); 
    $custom_content .= '<p class="last-updated">Actualización '. $updated_date .'</p>';  
    } 
     
        $custom_content .= $content;
        return $custom_content;
    }
    add_filter( 'the_content', 'wpb_last_updated_date' );

    For styling, didn’t work the style.css from the child theme, so I paste the following code in Customizer< advance options<Additional CSS:

    `.last-updated {
    font-size: small;
    text-transform: uppercase;
    }

    This codes slightly modified (for Spanish) are from this page:
    https://www.wpbeginner.com/wp-tutorials/display-the-last-updated-date-of-your-posts-in-wordpress/

    Irene

    (@arlinaite)

    What I could not solve is to remove the publication date of the home and category pages.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Google showing the upload date instead of last updated date’ is closed to new replies.