Missing meta tags
-
Yandex Webmaster reports a problem that all AMP pages are missing meta tags <Description>. Checked in the source code-indeed.
The page I need help with: [log in to see the link]
-
@artembratko If you use AMP in
transitionalmode by default your regular meta description is used for your AMP URL. As you are using AMP inreadermode you may need to implement your meta descriptions using theis_amp_endpointfunction.Inform me how you are currently adding meta descriptions and I can check, many SEO plugins feature AMP support.
Using the Yoast SEO plugin meta Description tags are filled in
@artembratko If you’re using Yoast then to apply the same meta descriptions you just need to install and active the Glue for Yoast SEO & AMP plugin. I can check once you’ve activated.
I already have the plugin installed: Glue for Yoast SEO & AMP
Here are screenshots:
1) https://prnt.sc/qr9iur
2) https://prnt.sc/qr9j5r
3) https://prnt.sc/qr9jn0@artembratko It looks like an issue with the Yoast plugin, see below:
https://github.com/Yoast/yoastseo-amp/issues/27I’m able to replicate the same issue from my side, which is corrected by adding the following to my themes functions.php file:
// ADD META DESCRIPTION IN AMP PAGE add_action( 'amp_post_template_head', 'add_meta_description' ); function add_meta_description() { if(function_exists( 'is_amp_endpoint' ) && is_amp_endpoint()) { $meta_description = get_post_meta(get_the_ID(), '_yoast_wpseo_metadesc', true); echo '<meta name="description" content="' . $meta_description . '">'; } }Can you try the above?
Now the meta tag has appeared in the code, but it is empty: https://prnt.sc/qrbulm
@artembratko Are you able to test while temporarily using another WordPress theme and with any other plugins which provide SEO features temporarily deactivated.
@artembratko I can see you have the meta description on your AMP URLs now. Did you make any configuration changes or was there another plugin impacting your meta tags?
I disabled your plugin altogether and am now working with this: AMP for WP-Accelerated Mobile Pages for WordPress
Thank you, Your code helped on my site https://www.mecuchi.ru.
// ADD META DESCRIPTION IN AMP PAGE add_action( 'amp_post_template_head', 'add_meta_description' ); function add_meta_description() { if(function_exists( 'is_amp_endpoint' ) && is_amp_endpoint()) { $meta_description = get_post_meta(get_the_ID(), '_yoast_wpseo_metadesc', true); echo '<meta name="description" content="' . $meta_description . '">'; } }
The topic ‘Missing meta tags’ is closed to new replies.