Regarding AMP Title
-
Hello,
According to Google Best practices, your H1 tag and Title tag should be consistent. See note here: https://support.google.com/news/publisher-center/answer/93981?hl=en&ref_topic=9010385&vid=0-239082747385-1531940355409
However, this doesnt seem to be the case with this plugin. This plugin is adding the sitename in front of the post title for the title tag.
So I have decided to fix this myself and wanted to ask whether a. this is the correct method and b. do you plan to address this issue in a plugin update?
In class-amp-post-template.php, I have replaced wp_get_document_title() with get_the_title($post_id)
‘document_title’ => function_exists( ‘wp_get_document_title’ ) ? get_the_title($post_id) : wp_title( ”, false ), // back-compat with 4.3
Also, for our non-AMP website we are using single_post_title() to populate the title tag but for AMP as you can see above we used get_the_title($post_id). Is this okay and whether get_the_title($post_id) and single_post_title() generate the same exact output irrespective of any special characters etc?
Thanks for your time!
- The topic ‘Regarding AMP Title’ is closed to new replies.