jafaircl/gatsby-plugin-amp

Don't Remove JSON+LD

Closed this issue · 3 comments

In the process of pruning out javascript from the header, it'd be great to keep the JSONLD script tag:

<script type="application/ld+json">
[{
  "@context":"http://schema.org",
  "@type":"BreadcrumbList",
  "itemListElement": [],
  ...
}]
</script>

It's used by crawlers to easily get structured data about the page and as a result those pages get special treatment in search results (via "rich snippets")

Since switching over to gatsby-plugin-amp, I noticed the application/ld+json tag is getting pruned. I'm no longer getting a "This page has valid structured data" message from Google's AMP tester.

Here are results from Google's search console AMP testing tool

Production (using my hacky regex replacement script)

image

Staging (using gatsby-plugin-amp)

image

Sorry it's taken so long to reply. I'll take a look and see if there's a way to not remove json+ld scripts

Should be fixed in 0.2.2

Thanks @jafaircl ! 😄