This tutorial is for anyone who is using WordPress. If you used Microdata to implement Schema in the past, you had to mark up the content that was actually on the page. This caused formatting issues and took a long time to get the page looking right. With JSON-LD it’s much easier. You can have your content on the page and style it the way you want. The JSON-LD script is separate than the content on the page. But you need to make sure that the information you are including in the JSON-LD script is also included on the contents of the page.
Make sure to add your business name, address and phone to each page on your website. The easiest way is to add it to the footer of your website. You can add other pieces of info to each page such as email address if you’d like as well. Just make sure that whatever you include in the JSON-LD script is also viewable by website visitors on each page that contains the JSON-LD script. Some info is not necessary for viewers though, such as lat and long coordinates.
Install the SOGO Add Script Header Footer plugin. It’s free and can be found here.
Configure the SOGO Add Script Header Footer plugin. Go to the “Setting” tab in your WordPress admin. Click on “Header Footer Settings”.
Once you are in the SOGO Add Script Header Footer settings area, check the boxes next to “Limit Footer To” for “Post” and “Pages”. This means you want this script to be included on all post and web pages. You can check the other boxes if you’d like. That’s all depends on what types of content you want this script to be included on. For LocalBusiness Schema purposes, you really only need this on posts and pages.
Copy and paste this JSON-LD template into a text editor. I like Brackets. It’s also free. Replace all of the information in capital letters with your own business information.
Use this guide to find the CID number for your Google My Business listing.
Now copy and paste the JSON-LD script that you just customized in your text editor. Paste it into the SOGO Add Script Header Footer settings in the "Footer" box. Now click "Save Changes".
Note: You can add the code anywhere on your website. It doesn’t matter if you place it in the head or the body section. Google will have no problem reading the code. Since JSON-LD is a data linking format, there are no additional requests to the server. Therefore, it doesn’t matter if the script is loaded at the top or bottom of the page – there is no render delaying whatsoever.
Once you have added this script to your website, you will need to confirm that you have implemented the code correctly by using Google's Structured Data Testing Tool. Simply enter the URL of the website that you installed the script on under the "Fetch URL" tab. Or you can copy and paste the script into Google's Structured Data Testing Tool under the "Code Snippet" tab.