Support » Plugin: AMP » Meta Description in AMP pages

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support James Osborne

    (@jamesosborne)

    @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
    } );
    Thread Starter e-commerce-concept

    (@e-commerce-concept)

    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

    Plugin Support James Osborne

    (@jamesosborne)

    @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:

    Thread Starter e-commerce-concept

    (@e-commerce-concept)

    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

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Meta Description in AMP pages’ is closed to new replies.