You want a higher search rank? Implement Microdata on your website – simple as that. In fact, Schema has been proven to be so important to your search results, that you really should consider dedicating the time to do it, right now. SEO is code, nothing more, nothing less.
Please note that this article requires basic understanding of HTML and PHP. If you are unsure what to do, we advise you to contact a professional, or ask for professional assistance.
Also Read: Schema – Getting Started
On our last Schema guide, we learned how to implement microdata on static elements. These could range from the body’s tag all the way to assigning data-attributes for links, depending on their significance to our content. There are also different types of itemscope tags.
This time around, we are going to use the Schema attribute for articles (see documentation).
Introductory Points
We’ll be working under the template file single.php, or, if you have assigned different custom post types to your installation, look for single-posttype.php. There is also a more complex way of adding attributes requiring the use of javascript – which provides us with even more liberty.
Let’s stick with single.php: first off, define what the post-page is.
<body itemscope itemtype="http://schema.org/Article"> ... </body>
Crawlers and robots will immediately understand that the page is in fact an article.
Fortunately, we don’t need extra rules for our header, navigation, footer links, related and significant links, site names, pictures and anything else commonly available on every part of our website, because we have already defined those with basic microdata tags. Let’s proceed to our dynamic content.
WordPress Articles
Post titles on WordPress are defined by <?php the_title() ?>, working within a query. We can’t exactly go add a microdata tag in there. That bit of PHP is probably located within a heading tag <h1> or a span class, within your single.php template. Here’s what we can do:
<h1> <span itemprop="name"> <?php the_title() ?> </span> </h1>
Similarly, for our author, contributor, dates and anything else required (see further documentation).
Let’s say we want to dynamically connect our posts to a blog page (Schema=webpage):
<p> <a href="<?php the_permalink() ?>" itemprop="significantLink"> <span itemprop="name"> <?php the_title(); ?> </span> </a> </p>
The premise is to include PHP markup within HTML markup, so you can effectively add data-attributes and microdata tags to classes and spans that hold your dynamic content in place.
Why do this? It’s like handing Google a map of your website.
Also Read: Schema – A Must for Improved Search Results
The examples depicted above are some of the things you can do with your WordPress installation and Schema. You should also check out our handy guide for implementing OpenGraph rules on your WordPress articles. Never forget to experiment in order to achieve the desired results.
Would you like to add anything to this story? Not sure how to implement Microdata on your website or online content? Drop us a comment below and we’ll be glad to help you out!
Related Stories:
- The Simple Secret Behind Getting your Content Shared
- Don’t Miss: Last Week’s Top 5 Social Media News
- 399 Million People Use Facebook Only from Mobile
You might also like
More from Experts Talk
Top 6 Clubs You Never Heard Of That You Need To Join On Clubhouse
Clubhouse users will tell you to join as many clubs as possible, but how do you know which ones are …
Welcome To Clubhouse: An Insider’s Look
Clubhouse is all the rage. It's new, it's audio and it is extremely addictive. The hype is real and I'm …
The Top 5 Stories On Social Media This Week
A new musical could soon come to life on TikTok, WhatsApp users are flocking to Signal and Fiverr will run …
The Top 5 Stories On Social Media This Week
Save the date, Twitter is bringing back verification this January. Oh, and it shut own Periscope too. How was your …
3 Courses To Help You Create Better Video Content For Your Ads
Here are three free Facebook Blueprint courses to help you take your content to the next level.
The Top 5 Stories On Social Media This Week
Tamagotchi never dies, 2020 in one word and a new test for 3-way live streams on Instagram. How was your …
The Top 5 Stories On Social Media This Week
Twitter does Twitter best, Salesforce bought Slack and Apple could be working on a matte black MacBook. Are you ready?
Finding Your Way Forward: Five Key Social Trends for 2021
Henk Campher, VP of Corporate Marketing and Head of Social Impact at Hootsuite, looks at five important social trends that …