Ongoing Giveaway Linky!

Article – Fixing Structured Data Issues on a WordPress Child Theme

Many of you may already be aware of Google’s change in structured data warnings & errors.  Structured data is a markup language that tells search engines, like Google, what type of content is on your site.  You can also use it to give other information as well, including author, publisher, and when something was last updated.  The easiest way to check the data for your site is with Webmaster Tools.  Originally, any issues with your structured data were displayed as warnings.  However, with recent Google updates to their algorithm, any problems are now displayed as errors.  (under Search Appearance).  This will affect how your page is displayed in Google searches and hurt your ranking.structureddataerrors1 structureddataerrors2 I am by no means an expert when it comes to all the newest coding, so I had to search the net to find out what code to fix, where it was, & how to fix it.  The main errors I was getting were author, publisher, update, and entry-title & I use WordPress….so I started my search there. The overall fix is quite simple for WordPress.  You need to edit your base php code for your posts.  You can do this by opening single.php (can also be loop, content, ect…).  You’ll need to add additional class tags to each one.   For example, you would entry-title to your title tag, like this:

<h1 class="post-title entry-title"><?php the_title(); ?></h1>

Depending on what theme you use, the coding may be a little different.  I won’t go into a lot of detail on this since I wasn’t able to fix mine this way.   In my case, I wasn’t able to access the single.php or any of the php files since I’m running on a child theme.  Fixing the code for child themes would normally be the same, but since I didn’t create the layout, I had no idea where to look. After reading a bunch of articles and scrolling through thousands of posts on help forums, I found two options that would work the best for my site.  One was to edit the functions.php.  I’ve had bad luck with messing with that in the past, but gave it a try.  It worked for about…oh…ten minutes before my site crashed.  I quickly re-uploaded the original file via FTP and got the site back up.  My other option was to use two plug-ins: AuthorSure and Itemprop WP.

AuthorSure

AuthorSure implements both the authorship & updated markup on your site, and gives you options on how it will display.  The plug-in works great and has been the only way I’ve been able to get the updated error fixed.  You have several options on how to display authorship and it creates an author page if you don’t have one.  I do have one, but I’ve not had any luck getting it to link up.  At moment, I have it displayed as a footnote in order for the update info to display:authorsure The plug-in is also supposed to add in the rel=”publisher” attribute as well, but it wasn’t showing up.  I ended up adding it, along with an author tag, to my Google+ profile link:

<a href="https://plus.google.com/profile id?rel=author" rel="publisher"><img src="image link” /></a>

I had to add the author tag to ensure that Google would be able to verify authorship.  If you don’t have it in your current link, you should add it to be on the safe side.  You also need to make sure that your email is verified as well.  Mine is verified but it hasn’t been showing up on the structured data checker.

Itemprop WP

Itemprop is supposed to fix all the errors, and can redirect to your author page.  However, for my site it only fixes that title…hence the need for AuthorSure.  I will look into seeing why all of the options don’t work for me and update this article, but I’m assuming that it’s a theme issue at the moment.

Both of these plug-ins have fixed all the errors on the individual posts and static pages.  The only thing that hasn’t been fixed is updated on the main page.  I’m not sure if there is a fix for that, but I’ll keep an eye out for it.  If you have come across or used any other plug-ins or code to fix your structured data issues, feel free to share them in a comment below.

Last updated by at .

Signature

Speak Your Mind

*

Current ye@r *

CommentLuv badge

Comments

  1. 1

    Hmm! Quite a tutorial on coding stuffs :D I would align my thoughts with Ryan above.

    This is also out of my scope. However, I agree the details are necessary for WordPress users. Understanding basic coding would come handy.

    Technically, I think these stuffs are a bit advanced for newbie bloggers!

    I have shared this comment in kingged.com – the social bookmarking website for content marketers where this post was shared and kingged.

    Sunday – kingged.com contributor

    http://kingged.com/fixing-structured-data-issues-on-a-wordpress-child-theme/

  2. 2

    I have a wp account, but I have only set it up as a back up. If I switch I will need to remember this. Very cool! Thanks for sharing at the Anything Goes linky at Bacon Time. Hope to see you again tomorrow.