How to add description in Structured Data on AMP pages?

Posted in: Newspaper
Post count: 8

Hello,

Google recommends adding the “description” on AMP pages structured data (Schema.org tags).
Source:- https://developers.google.com/search/docs/data-types/article#amp

I edited the td_module_single_base.php file (includes/wp_booster/td_module_single_base.php) and added the following under headlines markup:-

// description
$buffy .= '<meta itemprop="description" content="' . get_the_excerpt() . '">';

The description markup shows fine on Non-AMP article pages. However, when I check the Structured Data on Google’s Structured Data tool for the AMP article page, it doesn’t show the description.

On AMP article pages, it only shows the following in page source:-
<meta itemprop="description" content="">

Can someone please help me get the “excerpt” shown as the description in structured data on AMP article pages?

I’m using the Tagdiv’s AMP plugin that came with the Newspaper theme.

Thank you

  • This topic was modified 8 years by hakhan201.
  • This topic was modified 8 years by hakhan201.
Post count: 22421

Hello,

Since the amp plugin is a ‘plugin’, you should change the plugin files, not the theme files. Changing theme files will have no implication on the plugin. Not in this case anyway.
Try to add the code here: https://www.screencast.com/t/r6pHCFYbnCr

Thanks.

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newspaper’ is closed to new topics and replies.