Advanced Structured Data Markup Concepts

Google Search Console Structured Data Error Missing homeLocation

Some WordPress Theme developers, or even self-focused SEO plugin developers are trying to pull a monkey on the WordPress community by claiming that their Theme (or SEO Plugins) has Structured Data.

I don’t know about you but those Theme developers either really don’t know what they are doing, or, they do know, but don’t give a BS about your website’s success in the world of Semantically correct sites.


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.

What Can You Do?

You have to start diving deep in to your WP themes coding and find out where certain parts of its is generated from. That is, if your theme is already has any sort of code in its WordPress template files.

If it hasn’t, then you are actually in luck because then you can use advanced methods more precisely, and usually won’t complain with errors.

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 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=""'; }
elseif (is_home()) {echo ' itemscope itemtype=""'; }
elseif (is_search()) { echo ' itemscope itemtype=""'; } 
elseif (is_author()) { echo ' itemscope itemtype=""'; }
elseif (is_date()) { echo ' itemscope itemtype=""'; } 
elseif (is_tag()) { echo ' itemscope itemtype=""'; } 
elseif (is_archive()) { echo ' itemscope itemtype=""'; } 
elseif (is_category()) { echo ' itemscope itemtype=""'; }
elseif (is_page('sitemap')) { echo ' itemscope itemtype=""'; } 
elseif (is_page('contact')) { echo ' itemscope itemtype=""'; } 
elseif (is_page('about')) { echo ' itemscope itemtype=""'; } 
elseif (is_page('wordpress-schema-markup-plugins')) { echo ' itemscope itemtype=""'; }
elseif (is_page() && !is_paged()) { echo ' itemscope itemtype=""'; }
elseif (is_page() && is_paged()) { echo ' itemscope itemtype=""'; }
elseif (is_single() && !is_paged()) { echo ' itemscope itemtype=""'; }
elseif (is_single() && is_paged()) { echo ' itemscope itemtype=""';}?>>

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=""'; }
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 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 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="">

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.

Author: RankYa

Online Entrepreneur, Qualified Web Developer, Google AdWords and Google Analytics Professional. Specialist in: Google SEO, Website Optimization, WordPress, Structured Data, JSON-LD, Microdata, Microformats, RDF, Vocabulary, HTML5, Advanced Image Optimization, Google Search Console, Google Webmaster Guidelines, Social Media Marketing, Facebook marketing and YouTube video ranking.

Thank you for sharing this blog post. Description: 'Advanced Techniques for Adding Structured Data Markup to WordPress shows how to insert coding to WordPress built web site using manual coding'