Incorrect published time on Amp version
-
The publishing time on the Amp version is lagging with 6hrs different from the publishing time on the non-amp version. How do I fix this error?
The page I need help with: [log in to see the link]
-
Hello @collins1980
Thank you for the support topic, it seems you are using the Jannah theme, it forces AMP settings programmatically which also includes forcing their own AMP template instead of using the AMP plugin’s template.
The code that outputs publishing time is also part of their templates on both AMP and non-AMP pages, so we will suggest approaching Jannah theme support
The code that modifies the AMP settings and forces you to use different themes is located in
/themes/jannah/framework/plugins/class-tielabs-amp.phpThe template Jannah theme is forcing can be found in
/themes/jannah/framework/plugins/amp-templates/ directoryYou can use the above code reference to mention when asking for support to Jannah theme since the issue is with your theme I will mark this as resolved.
Hope this helps!
Thanks for the clarification.
It may be that Jannah forked the AMP templates at a time in which they had a bug with the timezone. See https://github.com/ampproject/amp-wp/issues/6316 and/or https://github.com/ampproject/amp-wp/pull/5335
After a series of work, it doesn’t work. I changed the theme in order to check if the cause is from Jannah, yet the problem persists when using the default theme. Currently using Generatepress theme and publishing time on Amp is 16hrs difference.
Can you please check after clearing the cache, also please send us your site health info using AMP->Support and share the UUID with us
I have cleared cache but the problem persist.
ampwp-297ecbd1-9243-589f-8a39-5f2ee98386e2
Hello @collins1980
I think the issue is specific to that post, as I checked other posts with comparing AMP and non-AMP pages I got the same timestamp
eg:
non-AMP: https://afrinik.com/ta-set-neferu-valley-of-the-sleeping-queens/
AMP: https://afrinik.com/ta-set-neferu-valley-of-the-sleeping-queens/?amp=1non AMP timestamp : 2022-01-24T12:55:26+00:00
AMP timestamp : 2022-01-24T12:55:26+00:00I will recommend correcting timestamp by resaving post or choosing different time while saving post that post
When you visit the same above post from SERP, you will see the time difference of 2hrs, or more from the published time, happening only on the AMP version.
@collins1980
The Search engine stores the AMP Cache version of the page when it crawls the page, the timestamp is stored in the AMP cache correctly along with text, The text ( 2 mins ago ) is not updated dynamically it in the AMP cache in that case it search engine bots needs a revisit to update the textthat’s the reason SERP display the correct text, but not the AMP Cache page
Screenshots
1) SERP (3 hours ago) – Screenshot 12) AMP cache Page (2 mins ago) This will update once Search Engine bots revisit – screenshot 2
3) Direct AMP page (3 hours ago ) – Screenshot 3
You can learn more about AMP cache using this guide
Please, how would I fix that issue. Whenever I activated google signed exchange, it works best on the non-amp version but keeps popping errors of “The dates for the signed exchange are invalid”, on search console.
Hello @collins1980
It will be best to contact your hosting regarding a signed exchange setup this is something that we don’t provide support in AMP plugin as it requires hosting-related changes.
As I mentioned before the AMP cache version requires to be updated, which requires (revisit) re-indexing by google bots, you can request the same in GSC
You can however try changing the time format in case you don’t want human-readable time eg: instead of 2 mins ago you can make it say Published on Published on January 24, 2022
Step 1: Create a directory named
ampin generatepress themeStep 2 : create file name
meta-time.php
The file path will bethemes/generatepress/amp/meta-time.phpStep 3: Copy the below code and paste it into that file
<div class="amp-wp-meta amp-wp-posted-on"> <time datetime="<?php echo esc_attr( gmdate( 'c', $this->get( 'post_publish_timestamp' ) ) ); ?>"> <?php echo esc_html( sprintf( /* translators: %s: the human-readable time difference. */ __( 'Published on %s', 'amp' ), get_the_modified_date() ) ); ?> </time> </div>Once this done wait for more than 2 weeks so changes can reflect on AMP cache
Hope this helps!
-
This reply was modified 4 years, 4 months ago by
Milind More.
-
This reply was modified 4 years, 4 months ago by
Milind More.
@collins1980
As we didn’t receive a response I’ll mark this as resolved. Feel free to open a new support topic if you require any further assistance. -
This reply was modified 4 years, 4 months ago by
The topic ‘Incorrect published time on Amp version’ is closed to new replies.