wp-seopress / wp-seopress-public

SEOPress, the best WordPress SEO plugin available on the market to rank higher in search engines.
https://www.seopress.org
30 stars 15 forks source link

Make SEOPress JSON Schema easier to access #69

Closed jdevalk closed 2 months ago

jdevalk commented 3 months ago

I currently have a site that is using SEOPress and I need access to its JSON output so I can use the data in there in Google Tag Manager to enrich the data we're measuring. Unfortunately the JSON block has no class or id attributes, it's just plain, for example, from a playground site:

<script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"WebSite","name":"My WordPress Website","alternateName":"My WordPress Website","description":"","url":"https:\/\/playground.wordpress.net\/scope:0.5286949071770433","potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/playground.wordpress.net\/scope:0.5286949071770433\/?s={search_term_string}"},"query-input":"required name=search_term_string"}}</script>

Could you give that script tag an identifiable class like seopress-schema or even website-schema or something similar? That way I could grab them with JavaScript a lot more easily.

wp-seopress commented 3 months ago

Issue opened to our private Github repository to handle this for our next major update.

ETA: this month