Meta Description in AMP pages
-
Hello,
Where is the meta secription tag ?
Meta Title is ok, but no meta description ?
Best regards
PatrickThe page I need help with: [log in to see the link]
-
@e-commerce-concept As you’re using Yoast you can install Glue for AMP & Yoast, which should use your regular meta descriptions in your AMP URLs.
An alternative is to use a function such as the below, added to a custom plugin or your themes functions.php file. This will add the a meta description across all AMP URLs in
reader
mode.add_filter( 'amp_post_template_head', function() { ?> <meta description="Example description"> <?php } );
Hello,
Thank’s for your answer,
but, i have installed GLUE for AMP & Yoast
And in your alternative solution, all pages will have the same description.
it would be better to replace “example description” with the system variable of the Meta Description
Best regards
Patrick@e-commerce-concept Correct, that would be a static meta description. You could apply the below, but without a plugin it would look at your general settings “Tagline”.
add_action('amp_post_template_head', function() { echo '<meta name="description" content="'.get_bloginfo('description').'">'; });
You could also change it to one of Yoasts variables:
Hello, thank you for this, we forward
The tag variable for meta descrition of the page is : %%tag_description%%
Where i write this in function.php :
add_action('amp_post_template_head', function() { echo '<meta name="description" content="'%%tag_description%%'">'; });
your code put the Blog Description in Meta ?
Best regards
PAtrick
- The topic ‘Meta Description in AMP pages’ is closed to new replies.