Add the meta description tag to your AMP pages

0
Add the meta description tag to your AMP pages

In this post we will see how to add the meta description tag to our AMP pages . Specifically, an example of how to include the meta description tag generated by Yoast SEO and All In One Seo Pack plugins .

These two SEO plugins, perhaps the most used. They store vital information to build labels needed to optimize the SEO of your custom fields entries. For the meta description, Yoast SEO uses a custom field with the name _yoast_wpseo_metadesc , and AIOSP a custom field with the name _aioseop_description .

The next thing is to create the meta description tag , and inject it into the head of your AMP pages . The official AMP plugin includes in its templates an html-start.php file with the following content:

As you can see, the AMP plugin for WordPress puts the hook amp_post_template_head at our disposal . That’s where we will generate and inject the meta description tag.

If you use the Yoast SEO plugin , the code that you must add in the functions.php file of your theme or in your utilities plugin is the following:

If you use the AIOSP plugin , the code that you must add in the functions.php file of your theme or in your utilities plugin is the following:

 

LEAVE A REPLY