• Resolved Suanlian Tangpua

    (@suanlian)


    Hi Again,

    How do I change the original post date to the Updated date? The original post/publish date is shown on the amp article while google SERP and main website shows the updated date.

    *Reader Mode

Viewing 3 replies - 1 through 3 (of 3 total)
  • @suanlian To change the date format you can create a reader more template override for the meta-time.php file. To do so perform the following:

    1. Create a folder called amp in your active WordPress themes root directory
    2. Copy the meta-time.php file from the amp plugins template directory (wp-content/plugins/amp/plugins)
    3. Paste that file into the newly created amp folder in your active theme
    4. Edit that file by replacing the following:
      echo esc_html(
       sprintf(
        /* translators: %s: the human-readable time difference. */
         __( '%s ago', 'amp' ),
           human_time_diff( $this->get( 'post_publish_timestamp' ), current_time( 'timestamp' ) )
       )
      );

      With the following, or any other date format/prefix you prefer:
      printf( __( 'Updated: %s', 'amp' ), get_the_modified_date() );

    Thread Starter Suanlian Tangpua

    (@suanlian)

    James Osborne, Thank you! It is working perfectly!

    ** 2. The root is (wp-content/plugins/amp/templates) ??

    Thank you!

    @suanlian Thanks for the correction! And glad you got it sorted. Feel free to leave the plugin a review if you find it works well for your site.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to change the post date to update date in AMP’ is closed to new replies.