Advanced Structured Data Markup Concepts

Advanced Structured Data Markup Concepts

 In Structured Data

Did you know that you can so much more with Structured Data Schema Markup than what most SEO’s are telling you? For example: now moving forward to 2020 Google Mobile First Index World, you have featured snippets? Although Google help section says this:

How can I mark my page as a featured snippet? You can’t. Google systems determine whether a page would make a good featured snippet for a user’s search request, and if so, elevates it.

Does NOT mean you can’t. Because you can using RankYa SEO techniques and structured data.

Welcome to Advanced Structured Data Markup Concepts by RankYa

First thing to understand about using Structured Data is this fact: Google is NOT the only search engine that supports Structured Data.

Structured Data Basics Simplified

Think of Structured Data as GROUPED THINGS.

Then, think of Schema.org Markup, JSON-LD, Microdata, HTML5, The Product Types Ontology, RDFA are methods FOR GROUPING THINGS

When we talk about THINGS, they are just that ‘THINGS’ on the digital scene so to speak. THINGS that search engines, computer programs, user-agents understand and interpret simple machine-readable data.

THING IS A THING

But since THING is EVERYTHING, Structured Data allows you to specify and group THINGS in to more meaningful TERMS. Using Structured Data you can give meaning to whatever is on your website.

website elements and type of scopes in structured data

Now the meaningless old HTML code has just become alive with meaning. And those who can understand it (Google Yandex or other user-agents) can use it to display content accordingly.

For example: let’s imagine a person using their mobile phone searches Google with terms ‘Locksmiths in Houston TX‘  for a local business offering  locksmith services. Using its algorithms, Google can better display many things including contact page for a locksmitha, address or even a phone number

Another example: people searching for ‘Asus Laptop Buy Australia’. Google can display different results accordingly. In first example, it will display a LocalBusiness, and the second example it will display Product (usually with Google Shopping first for products).

What Can You Do?

If you are a beginner to structured data, then

If you are a web developer or SEO specialist who wants to learn more, then visit

Adding Schema Markup to ANY Website

First ask yourself and identify what is it that you are offering on your site, and also what type of content you have. Are you a local business? Selling products? Do you showcase your telephone number, address details, do you blog for How to’s, do you have Questions and Answers page and or others. Then, according to each element you want to markup. Go and visit the Schema.org to see sample examples for adding Schema Markup.

How NOT to Add Schema Markup to WordPress

First, because Structured Data is now more important than ever before. Most WordPress Theme developers are quick to TRY to add Schema Markup. Stay away if you do not want the headache because no two WordPress sites are ever the same, nor, can you and hope that all of the users will use it the same way. Its just not going to happen.

Also, there are many WordPress Schema Markup Plugins which claim to add FULL SCOPE of Schema Markup, once again, if you want to truly take advantage of using Structured Data on your WordPress site, do not use Schema Markup WordPress plugins.

In fact, there can never be a WordPress plugin that can add structured data completely

How to Add Schema Markup to WordPress

You have to start diving deep in to your WordPress theme’s coding and find out where certain parts of its HTML generated from. That is usually <header> <nav> <article> within header.php sidebar.php footer.php and other WordPress template files

Begin from HTML to Footer

Many years ago, I was marking up websites starting from the < body > tag, then later, as I’ve learnt more and more about how to properly use schema.org markup, I found out that you could give so much more information to search engines (, bots) starting from the itself. Because that tag represents the root of an HTML document.

That is why, always markup starting from the html tag (this is found in  in your WP theme)

<!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js"<?php if (is_front_page()) {echo ' itemscope itemtype="https://schema.org/WebSite"'; }
elseif (is_home()) {echo ' itemscope itemtype="https://schema.org/CollectionPage"'; }
elseif (is_search()) { echo ' itemscope itemtype="https://schema.org/SearchResultsPage"'; } 
elseif (is_author()) { echo ' itemscope itemtype="https://schema.org/CollectionPage"'; }
elseif (is_date()) { echo ' itemscope itemtype="https://schema.org/CollectionPage"'; } 
elseif (is_tag()) { echo ' itemscope itemtype="https://schema.org/CollectionPage"'; } 
elseif (is_archive()) { echo ' itemscope itemtype="https://schema.org/CollectionPage"'; } 
elseif (is_category()) { echo ' itemscope itemtype="https://schema.org/CollectionPage"'; }
elseif (is_page('sitemap')) { echo ' itemscope itemtype="https://schema.org/CollectionPage"'; } 
elseif (is_page('contact')) { echo ' itemscope itemtype="https://schema.org/ContactPage"'; } 
elseif (is_page('about')) { echo ' itemscope itemtype="https://schema.org/AboutPage"'; } 
elseif (is_page('wordpress-schema-markup-plugins')) { echo ' itemscope itemtype="https://schema.org/CreativeWork"'; }
elseif (is_page() && !is_paged()) { echo ' itemscope itemtype="https://schema.org/WebPage"'; }
elseif (is_page() && is_paged()) { echo ' itemscope itemtype="https://schema.org/CollectionPage"'; }
elseif (is_single() && !is_paged()) { echo ' itemscope itemtype="https://schema.org/Blog"'; }
elseif (is_single() && is_paged()) { echo ' itemscope itemtype="https://schema.org/CollectionPage"';}?>>

The above sample comes from RankYa Theme, but you can easily modify the example schema markup code to match your own website needs. Simply take a note of the and also, the page names, meaning:

elseif (is_page('sample-page-permalink')) { echo ' itemscope itemtype="https://schema.org/CreativeWork"'; }
elseif (is_page('another-example-page-permalink')) { echo ' itemscope itemtype="Ask yourself what type of abstract item will be on that page? Is it a WebPage, is it a Product, is it a CreativeWork, is it a AboutPage, is it a ContactPage? And so on"'; }

So once again, start from the html tag, and think of it as the root of a tree, it is the most abstract itemscope

  • This is the main schema.org hierarchy: a collection of types, or classes

Then You Can Make The < head > tag Become Really Smart for Search Engines

By including all sort of information depending on your site setup. For example:

<?php if (is_front_page() && !is_home()) : ?>
<title itemprop='name'>Site Name</title>
<?php endif; ?>
<?php if (!is_front_page() && !is_home() && is_single() || is_page('contact')) : ?>
<meta itemprop="accessibilityAPI" content="ARIA">
<?php endif; ?>
<meta itemprop="isFamilyFriendly" content="TRUE">
<meta itemprop="accessibilityControl" content="fullKeyboardControl">
<meta itemprop="accessibilityControl" content="fullMouseControl">
<meta itemprop="accessibilityControl" content="fullTouchControl">
<meta itemprop="accessibilityFeature" content="alternativeText">
<meta itemprop="accessibilityFeature" content="structuralNavigation">
<meta itemprop="accessibilityHazard" content="noFlashingHazard">
<meta itemprop="accessibilityHazard" content="noMotionSimulationHazard">
<meta itemprop="accessibilityHazard" content="noSoundHazard">
<meta itemprop="copyrightYear" content="<?php echo date("Y"); ?>">
<meta itemprop="copyrightHolder" content="Name of the Copyright Holder">

Most of these sample schema markup is to do with which are very important part of World Wide Web w3 Standards

Then Comes the HTML body tag

For WordPress sites, you would actually want to not markup the at all, reason being the way WordPress works to blurt out different parts depending on what is requested. For example: pages are pages, blog posts are posts which both require different schema markup. Which you couldn’t define using the body tag itself.

But you can take a look at page.php and also single.php (some themes use template part such as content-page.php and content-single.php) to blurt out portion of HTML for you to modify and . Most importantly, the single.php which takes care of your blog posts. And should have

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">

For marking up the blog post portion. Furthermore, for typical web pages, you then may need to blurt out

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?><?php 
if(is_front_page() && !is_home()) {echo ' itemprop="mainEntityOfPage"';} //This is coming from the THING
elseif (is_page('wordpress-schema-markup-plugins')) {echo ' itemprop="mainEntityOfPage"';} //because CreativeWork which you are now calling in <HTML isn't
elseif (is_page() || is_author || is_home() || is_archive() || is_date() || is_tag() || is_category()) {echo ' itemprop="mainContentOfPage"';}?>>

Even More Advanced Concepts Can Be Found in this Video Lesson

These are the complexities of adding schema markup to WordPress sites. When you now compare these codes to the < html > tag example in the first instance, then you will see the logic behind these samples for inserting different content markup depending on the  of the html tag.

Thank you for learning with RankYa and sharing this blog post.

Recommended Posts
Showing 2 comments
  • Travis Karns
    Reply

    Implementing schema on my site has been a challenge. I hadn’t been able to find the plugin that would add the markup that I wanted. I’ve been learning to code so; I haven’t been able to do it manually. But once you explained starting with the HTML tag, it was a “Duh, that makes so much sense” type of moment. I’ve probably looked at more than 200 articles on implementing schema, but this was the first time I’d heard of approaching it like you’ve laid out. Thanks so much for writing this article.

    • RankYa
      Reply

      Thank you Travis, its great that you are interested in learning about Structured Data markup, and yes, I too had many “that makes more sense moments” while learning about this interesting field of schema markup (more content will be added soon) till then

Leave a Comment

0

Start typing and press Enter to search

Google Search Console Structured Data Error Missing homeLocationGoogle Search Console Structured Data Error Missing homeLocation