Quick Win: Add JSON-LD Organization data to your WordPress website

Quick Win: Add JSON-LD Organization data to your WordPress website

Structured data is important for your website. It helps search engines to get a better understanding of your content. If you don’t know what I’m talking about, just grab this JSON-LD code Organization snippet and add it to your website for a quick win.

We’re using the JSON-LD markup. JSON-LD is the Google recommended format for adding structured data to your website. Adding this snippet gives Google and other search engines a lot of information about your Company or Organization. The data you add to it may or may not appear in the results of particular searches.

The JSON-LD code snippet

Add this code to your functions.php file that’s located in the root of your child theme:

add_action( 'wp_head', 'render_json_ld_organization' );
function render_json_ld_organization() {
    ?>
         
    {"@context": "http://schema.org", "@type": "Organization", "url": "https://www.webmatic.be", "logo": "  /assets/images/logo-webmatic.png "," contactPoint ": [{" @type ":" ContactPoint "," telephone ":" + 32-484-596-744 "," contactType ":" customer service " , "availableLanguage": ["Dutch", "English"]}], "sameAs": ["https://www.facebook.com/webmaticdesigns", "https://in.linkedin.com/company/webmaticdesign "," https://plus.google.com/b/105299632303296666595 "," https://www.pinterest.com/webmaticdesign "," https://twitter.com/webmaticdesign "]} 

Be sure to edit this code to reflect your own data.

JSON-LD can be added to the head or body of your web page. I chose to add it in the head of every page.

And now look at all the stuff you just added to each and every page of your website: your point of contact, your phone number, your logo, your social profiles and more.

You can leave some structured data out or add other structured data to this code. More info can be found on the Google Support pages.

Now go and test your code in the Google Structured Data Testing Tool. This will point you to any errors you may have with your implementation.

What is structured data?

This is a definition by Google:

Structured data is a standardized format for providing information about a page and classifying the page content; for example, if is it a recipe page, what are the ingredients, the cooking time and temperature, the calories and so on.

There are several possible formats you could use when adding structured data to your website:

  • JSON-LD: JavaScript notation in one