In this video you’ll learn how you can create a knowledge graph card for your local business using Structured Data.
Links from the videos:
- Googles Reference for LocalBusiness
- schema.org/LocalBusiness
- Structured Data Generator
- Googles Structured Data Test Tool
Transcript:
In this video I want to demonstrate how to build structured data for local businesses. This is for everyone who runs a local business anywhere around the globe.
music playing
Hi and welcome back! Nice to have you in the sixth lesson of module 3 of my structured data training. I am Florian the developer of SNIP, the Rich Snippets and Structured Data plugin for WordPress. If you want to use the plugin please feel free to follow the link that you can find in the description area.
In this video I want to show you how a snippet for a local business is built. You hopefully took all the lessons from the previous modules. If not please jump back to the beginning or to a video where you think you need to refresh your knowledge. In this video it’s important that you have understood what structured data is and what Rich Snippets are. You need to know how and where you can find the right schema classes as well as their properties to create a snippet for a local business.
Let’s jump right in!
When users search for businesses on Google search or Maps, search results may display a prominent knowledge graph card with details about a business that matched the query. In this example you can see the search result for a restaurant. Google offers a button where it is possible to reserve a table directly on the search results page.
Please note that Google is currently piloting this feature with a small set of initial providers. They hope to open up the feature to more providers very soon.
Read the references
As always we open up the LocalBusiness page on Google’s reference to see how a snippet for local businesses may look like in search results; what you should do and should not do – and be really serious about that! If you do violate Google’s policies your markup might not show up and you risk a penalty with the end result that you maybe never get Rich Snippets back for your site. And last but not least what properties are totally necessary and which ones are just recommended.
This is the page where you find this document. Look it up, read through and then follow me to the next page. As always Google uses structured data from schema.org. On schema.org/LocalBusiness you can find all properties that are possible for this schema type. However as you could see on Google’s reference page: you don’t need every single property listed there. You only need the required ones to get a Rich Snippet in search results. However I highly recommend to add as much properties as you can. I will explain later why I recommend this procedure.
On schema.org a LocalBusiness is a child of an Organization which is a Thing. If you don’t know what I’m talking about right now please go back to module one of my structured data training. It will be explained in full detail how schema.org is structured.
As you can see here: a LocalBusiness has child schemas that you can also use. Search engines understand that all of them are children of the mother schema – which is in this case – is the LocalBusiness. So if you want to use the Dentist schema, because you think it fits best for your purpose, please feel free to use it. Search engines also have a deep understanding of all the schemas found on schema.org. So they understand exactly that the Dentist schema is a LocalBusiness, too.
It’s interesting that the LocalBusiness appears twice on schema.org. You can find it again under the Place schema. That totally makes sense because a LocalBusiness is always located in a certain place. When you click on the LocalBusiness link the browser will bring you to that specific page of that schema. As you can see the LocalBusiness schema and all of its child schemas can have thousands of properties. However you don’t need every single one to get a Rich Snippets in search results as I said before. But as always: you can add more if you can fill the properties properly. I’m sure that Google and other search engines will mark more more properties as a mandatory in the future because they did this a lot during the last months. To keep this video as short as possible I will stick with the recommended ones.
Alright. Let’s get started! In the video I will use the built-in generator in SNIP, my Rich Snippets in Structured Data plugin for WordPress. If you don’t have the plugin please feel free to use the structured data generator on my website to follow the video instructions. The free generator does not have all the features the built-in generator has. So it might be that you get stuck at some point. Especially when it comes to Global Snippets that allow you to automate structured data generation.
Create a Global Snippet
Let’s begin! I am logged in to my WordPress dashboard now. Let’s say I am the owner of a restaurant website. Because we have learned that Restaurant is a child schema of LocalBusiness I want to add this one to my front page. I have two options now: I can add a snippet to my front page directly or I use the Global Snippets functionality and attach the snippet to my front page via the ruleset. You may know already how you can add a snippet to a certain post and that is via these buttons here on the bottom. However I will go with the latter option as if in any case I want to use it on another site as well I can easily change the ruleset on that Global Snippet.
As you can see: SNIP comes with some predefined snippets already. Unfortunately at this point in time there is no LocalBusiness snippet ready for you. So I have to create one on my own. However that isn’t really bad as it’s super easy with the built-in generator.
All I have to know is what properties I need to use and this information can be found – as I told you earlier in this video – on Google’s reference page. I have opened up the reference page already. Google tells you exactly what properties are needed not only for the main schema – which would be the Restaurant in my case – but for all sub schemas as well. For example the business hours.
Because every restaurant has opening hours I am sure you need this one as well. And Google tells you how – for example – the openingHoursSpecification schema works in different scenarios. Here like standard hours, late night hours, all-day hours. And don’t be frightened about the code you see here. As I told you in my first videos: these are only key-value pairs.
Ok. Let’s go back to our Global Snippets and create a new one. I will give it a name. This is just for internal purposes. And I click here the “Restaurant” button. I can also search for “Restaurant” here. This is the same when I click here. And the plugin will intelligently load some properties that are needed for me.
Let’s start to fill the values.
The @id should be globally unique. And what do we do if you want something globally unique? Of course we use an URL for this. In this case I will use the “Blog URL” of my restaurant website.
The openingHourSpecification needs to be a sub schema of the type OpeningHoursSpecification. And this is what SNIP offers to you here. I will configure these sub schemas after I set all the main properties. So let’s move on quickly with the servesCuisine.
This is just a text of the type of the cuisine that my restaurant serves. I will just enter maybe “Traditional Bavarian”. Yes.
The image should be either an URL or a ImageObject. There was a time where Google only accepted the ImageObject sub schema but for now it’s okay to just enter the URL. Yep. And if you want to add a second and a third whatever image you can create multiple image properties. SNIP will merge them together later. I will quickly show you how that works. Image. So we have two images here. One on top and one at the bottom. And I’ll enter… Yeah… Maybe the URL of a second image here.
The name of the restaurant is maybe self-explanatory. I will enter here “La Bay”.
If you are using a rating plugin on your site that allows users to rate your restaurant you can set up the aggregateRating here. You can find more about this in the documentation of the plugin. I don’t use a rating plugin. So I will delete this property. We will see later that Google’s Rich Snippet Test Tool will show a warning of a missing field. However this property is not a required field and it will not prevent my Rich Snippet from showing up in search results.
Okay the menu should be the URL to a site where the menu can be found. I use a URL to a PDF document. You can also use an URL to another page on WordPress where the menu can be found of course.
The address property should inherit the PostalAddress sub schema. You can find it here. And as I said before I will fill all the values that are needed later. I will stick with the main schemas here.
The telephone number and the URL down here should be clear, too. I will just enter some demo content. For the URL I also use the blog URL.
potentialAction is the action that a user can perform directly from the search result. Google supports two methods here. At this point in time these are OrderAction and ReserveAction. I will go with OrderAction. Okay.
If you want your snippet to show a map where your restaurant is located you need to define the coordinates as well. So in the “geo” property we need the GeoCoordinates sub schema here. It will then load the longitude and latitude properties. I can add some example data here. Alright.
“department” inherits a LocalBusiness schema. If you have multiple restaurants with the same name located in different areas you can set that up here. So I would choose LocalBusiness and set it up accordingly. Note that you can set up multiple departments by add another department property to the main schema just like I did it with the image property. Because I don’t have any other departments I will delete this property.
“review” inherits one or more Review sub schemas. It only makes sense if the users can rate your restaurant and leave comments. As I said before this is not the case for me so I will delete the review property as well.
Now we only have one property left. That is the acceptsReservations property. In almost all cases, if your restaurant isn’t closed, you should set this to TRUE. And there is also a descendant type that you can choose from. And yes, just select “TRUE” and you are good to go.
Now let’s go back to the sub schemas we have left over. The first one is the OpeningHoursSpecification schema. What you need to do here is to basically just choose the days and the opening- as well as the closing-times. That are basically just three properties and that are: dayOfWeek, which specifies the day of the week. “opens” and “closes”. So I would add here – let’s say – “Saturday”. So please enter the English names here. You can always go back to Google’s reference and see what properties are possible. Let’s say my restaurant is open from 9 o’clock in the morning till 9 o’clock in the evening. So now if your restaurant has more than just one opening hour you can always add more openingHourSpecification properties just like we did with the image. So in this case I would add another openingHourSpecification with maybe “Sunday”. Opens at 11:00 and closes maybe at six. As I said before: if there are two or more properties with the same name they will get merged together later by the plugin.
Of course there is the address property that we need to fill. I think that’s clear. Alright!
And then we have our potentialAction which is the OrderAction. For the OrderAction we only need two properties and that is the deliveryMethod and the priceSpecification. The other ones can be deleted. The deliveryMethod allows two different values that can be found on Google’s reference. And these are the two values that you can use. I’m just using the first one. Alright. And for the priceSpecification we need the deliveryChargeSpecification. And then when you go back and check what we need here, priceSpecification applies to deliveryMethod and is only needed if we have chosen the “DeliveryModeOwnFleet” so we don’t need it. The price let’s say five. CurrencyCode: euros. And here we need the transactionVolume which is a PriceSpecification as well. And we also need the price. And the priceCurrency. Yes. Here it is. Okay. Let’s say we say 20 euros. So that’s it!
We do deliver to someone if the transactionVolume is over 20 euros and it costs 5 euros for each delivery. Alright. I think that’s it. Don’t forget to save or directly publish it.
Oh! One thing! We need to choose where this snippet should appear. And I choose “page type is the front page”. Publish.
Test your Structured Data
So now we test our front page with Google’s Structured Data Test Tool. You would enter the URL to your front page here. I need to enter the snippet that the plugin has created manually as I’m on a local development site where this tool has no access to.
Okay. I run the test.
Now you see that we get two errors and when we scroll down we see them. Google says that “appliesToDeliveryMethod is missing or is required”. This is because we have defined a priceSpecification but we don’t need it if we don’t use the delivery method called out here – which is… Here… … the DeliveryModeOwnFleet. So what we can do here is basically delete this priceSpecification property altogether because we only offer the pickup service here.
What’s also missing is the target and you cannot find a lot about the target property here on Google’s reference page. But you can see it on the example and here you can see that target property should be the EntryPoint and I guess it’s structured like this: the urlTemplate is the URL where someone can order directly online in what language and here are the platforms where it’s possible to order online. So for me it would basically just the DesktopWebPlatform. Which means a user can order directly with a like a form or something on my website because I do not have Android or iOS platforms.
So let’s go back to our Global Snippet. Search for the OderAction. So we delete the priceSpecification because we don’t need it. Oops. Delete.
And then we add “target”. “target” which should be the EntryPoint. And we need here the actionPlatform and as I just said I only need the DesktopWebPlatform. And the urlTemplate is the form where someone can order online.
Alright. What else? We need the inLanguage property as well. So lets search for this. inLanguage. And because it’s German I think de-DE okay. Alright.
That’s it! Let’s save. And test our snippet again using the Structured Data Test Tool. Again: you need to enter you URL here again. I need to enter the code snippet. Alright. And now we see we have just one warning. As always: warnings are not errors. They do not prevent your Rich Snippet from showing up. And yeah. You can always enter the priceRange later if you like.
And if we click the preview button you can see a quick preview. But beware: this is not very accurate at this point in time. As you can see you don’t see any titles or something. It’s pretty basic. Just to give you a clue.
Conclusion
Alright. Let’s sum everything up what we have learned in this video.
- At the time of the making of this video the LocalBusiness snippet is only available for those who registered their websites on Google’s reference page and only if the application was accepted.
- A prominent knowledge graph card with details about a business that matched the query will show up in search results if the page was marked up with a LocalBusiness schema or one of its child schemas.
- I have explicitly mentioned the Dentist schema in this video but the LocalBusiness schema has a lot more child schemas that you can also use.
- To find the right properties use Google’s reference pages to learn more what you should and should not do.
- Use schema.org to integrate more properties. I totally recommend to use as many properties as possible.
- If you have multiple stores on different locations try to automate as much as you can by setting up a Global Snippet as shown in this video using SNIP my Rich Snippets and Structured Data plugin for WordPress.
In the next video I will show you how to create breadcrumbs on search results. See you in the next video!
music playing