Posted on Leave a comment

Manually Add Structured Data WordPress Without Plugin Schema Markup

If you know bit coding knowledge & how to edit code to WordPress site you change bit have previous coding experience that is easier for you to learn schema markup. You just need to take some time to familiarize yourself with how it works.

Add schema to WordPress without plugin structured data, also known as schema markup, to your site is one of the more technical things, It can give you a significant SEO boost and increase your rankings. There are several ways through which you can add this markup to your site, either by installing a plugin or by manually adding the right code without use a plugin.

Adding structured data, also known as schema markup, to your site is one of the more technical things, It can give you a significant SEO boost and increase your rankings

Website through organic search requires two things:

  • Getting your site to rank near the top of search engine results pages and
  • Making the search snippet appealing so that users will click on it.

Schema markup helps with both of these tasks.

Well, i try to explain what schema markup is and how you can use it to help boost your website’s SEO, create rich search results, increase search traffic, and drive more engaged audiences to your website.

What is Schema Markup?

Schema markup is a code that you add to your WordPress site. Humans can see it on HTML tags and class, Search engines like Google use it to better understand your content and add something called rich snippets, Google’s Structured Data Testing Tool.

But that doesn’t give search engines all the information they need to be able to fully understand what your site is about and who it would appeal to. And that’s where adding Schema markup to WordPress comes in.

There is mainly two method to adding schema makeup to user WordPress site.

  • Manually Add Schema Markup to WordPress (using HTML tags) &
  • Use for Schema Plugin (use JSON format).

Step 1 – Start Adding Schema Mack-up Manually in Page body tag

Schema markup is added to the HTML within the body tag on your site.

Go to admin Dashboard → login → Appearance → Theme Editor → header.php

itemscope="" itemtype="https://schema.org/WebPage"

Well, find “<body” to this particular file name header.php, now add this snippets to your body section, after add your code like this.

<body <?php body_class('theme-body'); ?> itemscope="" itemtype="https://schema.org/WebPage">

Step 2 – Adding Schema Mackup in Header Section

Schema markup is added to the HTML within the header section on your site. So for example, you might see something like this on a header tag:

itemscope="" itemtype="https://schema.org/WPHeader"

Now, insert this schema mackup code to your WordPress header tag, google search console get menu items URL.

Go to admin Dashboard → login → Appearance → Theme Editor → header.php

Find ‘header‘ and add this above code mention schema.org

Code look like this:

<header id="masthead" class="site-header" itemscope="" itemtype="https://schema.org/WPHeader">

Step 3 – Schema Mackup in Menu Items URL

Yes, this is important setup to schema optimize all menu url to search console, this will bit difficult to adding itemprop=”url” to all menu items.

Now, this want to able access to your root directory, if you are a developer this is easy for you you can check it adding itemprop to all menu item manually without access root directory.

Adding structured data, also known as schema markup, to your site is one of the more technical things, It can give you a significant SEO boost and increase your rankings

or If you not understood how this can do no problem at all, i show you add all menu itemprop=”url”.

Well, you can login to your cPanel, go to root directory www_public, inside choose your website directory through the name of your domain name, if you are use primary domain stay this folder name ‘www_public’.

Find folder name wp-includes → class-walker-nav-menu.php

Find text into class-walker-nav-menu.php (name: ‘<a’ . $attributes), add this snippets into same, not this code look like this:

Adding structured data, also known as schema markup, to your site is one of the more technical things, It can give you a significant SEO boost and increase your rankings
'<a' . $attributes . ' itemprop="url">';

Hay, not check your website have all menu successful added itemprop=”url”

Step 4 – Breadcrumbs Schema Mackup Snippets

A breadcrumb trail on a page indicates the page’s position in the site hierarchy, this is an important part of almost every good website.

Well, breadcrumb have three section

  • First one is the website home page (this have a link),
  • Second post category (this have a link) &
  • Third one is same post name (no link).

Now, create breadcrumb enable schema, first you can find breadcrumb in your theme header.php file, Go to admin Dashboard → login → Appearance → Theme Editor → header.php

Inside head tag paste this code header tag

<script type="application/ld+json">
{
	"@context": "https://schema.org",
	"@type": "BreadcrumbList",
	"itemListElement": [{
	"@type": "ListItem",
	"position": 1,
	"name": "<?php echo get_bloginfo(); ?>",
	"item": "<?php echo get_home_url() ?>"
	},{
	"@type": "ListItem",
	"position": 2,
	"name": "<?php foreach((get_the_category()) as $category) { echo str_replace("Categoty ","",$category->cat_name) . ' '; } ?>",
	"item": "<?php foreach((get_the_category()) as $category) { $category->cat_name . ' '; } echo get_site_url().'/category/'.strtolower(str_replace(" ","-",$category->cat_name));?>"
	},{
	"@type": "ListItem",
	"position": 3,
	"name": "<?php echo get_the_title(); ?>"
	}]
}
</script>

Step 5 – Schema Mackup for Article

Adding structured data, also known as schema markup, to your site is one of the more technical things, It can give you a significant SEO boost and increase your rankings

If the site represents an organization or a person who doesn’t have a user account, you can simply input information on that person or organization instead of selecting a user.

Marking up single posts and pages with Article and Author data types, Marking up archive pages with the appropriate data type, e.g. Collection Page for taxonomy and date archives and Profile Page for author archives.

Now, add this code to your article tag it will help you to all your article data store ready SEO trough search console.

itemscope="" itemtype="https://schema.org/CreativeWork"

Well, find “article” or “post” this both because different theme has a different format, you can understand which data have this theme, for example you can inspect tools web page browser.

Now, you can add this code:

itemscope="" itemtype="https://schema.org/CreativeWork"
<article itemscope="" itemtype="https://schema.org/CreativeWork" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
 <h2 itemprop="headline" class="entry-title"><?php the_title(); ?></h2>
 <?php if ( has_post_thumbnail() ) { ?>                            
  <?php the_post_thumbnail( medium, array(
   'class' => 'left',
   'alt'      => get_the_title()
  ) );
  ?>                  
  <?php } ?>
 <section itemprop="text" class="entry-content">
  <?php the_content(); ?>
 </section><!-- .entry-content -->
</article>

This steps take you almost ready to enable schema we already looked at above which adds the relevant Schema markup to your site.

Step 6 – Author Box Schema Mackup

Well, i already discuss about this topic author box without use of plugin schema optimized check out more details about bio box with enable Schema Mackup to your WordPress site, an author bio box increases the authenticity of your blog, Marking up search results as Search Results Page.

Now, we will provide the PHP code, displaying the Author Bio Schema Optimized in your post page.

Go to sidebar menu Appearance → Theme Editor → single.php

<div class="site-content">	
<div class="author-box clear" itemprop="author" itemscope="" itemtype="https://schema.org/Person">
<span itemprop="image" alt="Photo of <?php the_author_meta( 'display_name' ); ?>">
<?php if(function_exists('get_avatar')) { echo get_avatar( get_the_author_meta('email'), '100','','author image' ); } ?>
</span>

<div class="author-meta"><h4 class="author-name">
<span>	<a itemprop="url" rel="author" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" itemprop="name">
<itemscope>About the <?php the_author_meta( 'display_name' ); ?></a>
</span></h4>

<div class="author-desc" itemprop="description">
<?php the_author_meta('description') ?>
</div>
</div>
</div>
</div>

Now Testing Your Schema Markup Online

After publishing or previewing the post, you can see the rich snippet towards, If you want to test whether or not your schema markup is working, you can plug your post’s URL or html snippet into Google’s Structured Data Testing Tool.

Google’s testing tool will indicate which aspects of Schema markup are present in your site and which are missing. If there are any missing that you think you need, you can then go back and recheck the schema mackup HTML tag settings the missing markup manually.

Leave a Reply

Your email address will not be published. Required fields are marked *