what is a simple and reliable way to insert schema markup (JSON-LD) in my static WP pages manually? My question is not about creating the JSON-LD code, but how to implement it in the WP source code. I don’t want to use a plugin or the Google Tag Manager.

JSON-LD markup is a script tag, which actually does not contain executable JavaScript as far as I know. It’s meta data which should not show up on front page, it’s information for search engines and looks like this:

    <script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "LocalBusiness",
  "address": {
    "@type": "PostalAddress",
    "addressLocality": "Mexico Beach",
    "addressRegion": "FL",
    "streetAddress": "3102 Highway 98"
  },
  "description": "A superb collection of fine gifts and clothing to accent your stay in Mexico Beach.",
  "name": "Beachwalk Beachwear & Giftware",
  "telephone": "850-648-4200"
}
</script> 

Some blogs in the web suggest to create a WP custom field.

Is this really the best way to do it manually and why?

At the moment I’m not sure where to place the code. In the head it may slow user visible loading time, but gives the JSON-code a clearly separated place from the important body source code. May be just before closing body-tag would be a nice place too.
Can I decide where to place it by using custom fields and how?

Thanks,

Martin

0

Leave a Reply

Your email address will not be published. Required fields are marked *