How to Write and Implement Schema Markup Code

By The Black Fin Team

Posted:

Category: SEO


What Is Schema Markup?

Schema markup is vital for both your business and your website. It allows crawlers (and therefore the search engines) to better understand the website that is being crawled, as well as the key business attributes that are therein defined.

Why It’s Important

  • Correctly marking up your business, services, products, and reviews provides search engines the means to classify, categorize and display your website and related marked up items correctly within the search engine results pages.

The full details in and around schema and the various areas for implementation are contained on the main website: http://schema.org/. However, this can get a little confusing, to say the least.

That’s why using a JSON-LD schema generator, where you can plug in your business details and generate the schema (in JSON format) for implementation into your website, is so valuable. We’ll get into the details of how to use a little later, but go ahead and click here to check out the generator you’ll be using.

Check Existing Schema

Your website may already have schema embedded into it, however, it is doubtful that it is comprehensive and complete. Go to https://search.google.com/structured-data/testing-tool/ and enter your website URL into the provided area:

Schema markup

The results will show the existing structured data on the right and the website source code on the left.

Pro Tip: This tool can be used to analyze what your competitors have in terms of existing structured data on their website.

Assuming you do not have the specific schema in place with respect to, at the very least, your organization/practice address details it’s time to get to work on putting this together.

Make Sure Your NAP is accurate

NAP, which stands for Name, Address, and Phone Number, should be identical across all websites that feature these details, including your local directories, aggregators and related services/providers (eg YEXT, Moz etc).

If you have an existing, verified and published listing with Google it is recommended that you use these details. Copy these details from your Google listing and use them as your NAP details on other sites, as well as within your Organization’s published data (on your website) and as well as your schema data. The example below shows where to access your NAP data that is listed on Google (if you do not have this already…).

Schema markup

There are additional details that will be required, and of course this depends on what type of schema you will be generating. In this instance the more information you have the better!

Using the Schema Generator

Go to the schema generator, and select the type of schema you wish to generate, in this module we will be focusing on your business and related properties (such as logo, hours of operation, address, description and so forth).

Schema markup

Step 1: Select Type of Markup

Complete all details as comprehensively as possible, an example is detailed below for reference purposes.

There are several issues you may encounter, and tips for these follows below.

Schema markup

Suggestions and comments

Type of Markup:
Select Local Business and Legal Service (as opposed to Attorney)

Name:
Full Business / Law Firm Name

Url is your website address

sameAs URL:
This applies to any social media profile that your firm may have. This includes, Facebook, LinkedIn, Google +, twitter etc

Images:
Add the URL of your logo image, and any additional image if applicable – this applies to the business.

Description of your firm, including practice areas…

Address:
NB This is where your NAP must match your other online listings.

Longitude and Latitude:
suggested for geographic accuracy (See below)

Map:
see below on how to get your map URL

Business Hours:
self-explanatory

Contact Type:
Suggested ‘Customer Service’

Finding your logo URL

Navigate to your website, and right-click on your logo, if there is an option of “Copy image address” per the below, this will suffice. Please note that this may not work in all cases.

Schema markup

Longitude and Latitude

Go to: http://www.geo-tag.de/generator/en.html

Enter your address details, and the longitude and latitude will be generated:

Schema markup

Locating Your Map Link

Navigate to your business / maps listing on Google, from the selection items available, select Share and copy the link from the popup box

Schema markup

Once the preceding steps have been completed you will have a set of schema data in the right box of the schema generator page … this should be highlighted by clicking in the box and selecting Ctrl+A or by placing your cursor before the opening <, click on your mouse and drag to the end so all text is highlighted and then copy it. This can then be pasted directly to the required area on your website or pasted into a text document before transferring over. Please note this must be a text doc, to preserve the code.

Schema markup

Highlight & Copy the Generated Json Script

Schema markup

Paste to a Text Doc

Schema markup

Check your Schema

It is always a good idea to check your Schema with the Google tool mentioned above, located here: , this time select code snippet and paste your newly generated code into the provided area:

Please note that it is possible that incorrect errors or warnings may be generated within this test. And which may require further tweaks or even some web developer input.

Adding the Schema code to your Website

Once you have generated your own json-ld script it is time to add this to your website. There are a number of different ways that this can be implemented, from the manual process to the automated process. The former can be added directly to the head section of your website (webdev suggested) or, if you are working with a WordPress website, this can be done via plugins or theme functionality that allows for such code insertion on the fly. Examples are themes that allow for custom header scripts (Genesis, Divi and a variety of other themes too), to that of plugins that will add this functionality, Header Footer scripts and so on.

Going beyond the perhaps a little more ‘advanced’ implementation defined above is by using plugins designed specifically for the insertion of the schema into a wordpress website. Please note that the addition of plugins may add unnecessary overhead to your website and have a direct impact on your pagespeed and overall website performance.

Some of the available plugins for WordPress that can assist you:

Inserting into your website / theme directly
Complete ‘manual’ installation:

Please Note: We cannot openly recommend any specific theme and/or plugin as we do not know what your current setup is. Some themes and plugins do not necessarily function seamlessly together and hence a couple of the more common themes and plugins are highlighted below.

Themes (Certain themes already have a user interface that allows for the insertion of custom scripts and code into the respective header, body or footer area of the website)

Elegant Themes

Genesis Child Themes (Studiopress)

Note: some themes and plugins may conflict with each other

Plugins (for adding scripts/code to the website)

Of course, there are many more and these are for illustrative purposes only.

Schema Plugins:

Additional Resources:

Find out how Black Fin can help
with your free consultation now


Client Review

Rating:

"I cannot be happier with Gerrid Smith and Black Fin, and highly recommend their services."

- Seth Gladstein, Gladstein Law Firm