Location for page specific scripts
-
Hi, I’m looking to add some schema to a specific page. I found tutorials on how to add the JSON-LD to a custom field, and then add some code to the header.php which pulls it in based on the page ID.
However, I noticed that in the page editing screen of wordpress, it has a section to add “Page-specific Scripts.
If I put the json-ld script in there, will it be output to the head or body? Is this acceptable or not? The script would look something like this (I think):
<script type="application/ld+json"> { "@context": "https://schema.org", "@type": "Product", "description": "The description of my product goes here", "name": "The name of my product goes here", "image": "https://www.mydomain.com/pictureofmyproduct.jpg", "offers": { "@type": "Offer", "price": "11.00", "priceCurrency": "USD" }, } </script>
Thanks for the help!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Location for page specific scripts’ is closed to new replies.