Google’s Webmaster Tools is very useful when you must assess how Google sees your sites. In order to use rich snippets and other features in search results it tries to understand the markup on your pages. However it’s possible that some of that markup to be incomplete or malformed. In this case the Structured Data page will show these errors.
The most common errors encountered on WordPress based sites are in the Microformats.org markup, namely missing update and missing author.
I’m not entirely sure, but these errors could, I say could, affect the page rankings, so it’s always a good idea to get rid of them.
Update: December 2018
It seems that, these days, the structured data errors are no longer an issue, with so many advancements in the currently available themes, and with the WordPress itself, which has evolved massively since I first wrote this article. And let’s not forget all those SEO plugins out there, which will definitely solve any such problem easily.
How to fix these errors?
In the picture below you can see my Structured Data page after I corrected these errors. Observe how the errors are going down steadily. It takes time until Google re-crawls all your pages.
In case you are using WordPress as your blogging platform, the guilty element is the theme you are currently using, not WordPress itself. Fortunately it’s quite simple to add the missing markup elements. For the vast majority of themes, the file that must be modified is single.php, and maybe also page.php. In some rare cases could be other files. Anyway, you should find all template files involved in displaying posts/pages in full or excerpt form.
The theme files to edit are located in a directory of this form:
/<site’s root>/wp-content/themes/<theme directory>
It’s best to use a child theme and make all changes there. This way your changes won’t disappear at the next theme update.
Now let’s go into details on how to fix structured data errors.
Fixing the “Missing: update” Error
- Locate the function displaying the date of the post within the single.php file:
<?php the_date(); ?>
I’m using a Builder theme (I’m one of those “rare” cases), and I found my date function in post-formats/content.php and post-formats/content-single.php, and the date function used was
get_the_date()
, but you get the point. - Wrap this code snippet with a
<span>
element having style classes"post-date updated"
, like this:<span class="post-date updated"><?php the_date(); ?></span>
In case there is already a span element wrapped around the date function, make sure it has these two style classes assigned: post-date and updated.
Fixing the “Missing: author” error
- Locate the function displaying the post author within your single.php file:
<?php the_author(); ?>
Again, the file(s) and function may be different. In my Builder theme I found a custom function
builder_get_author_link()
in the same two files. - Wrap the code snippet with two
<span>
elements, like this:<span class="vcard author post-author"> <span class="fn"> <?php the_author(); ?> </span> </span>
The inner
<span>
element is necessary because the vcard markup requires at least one child element.
How to edit the files?
The hosting companies usually provide some sort of file management application available through their CPanel interface, but the best choice would be an FTP client. You can download the file, edit and then re-upload later.
Personally, I’m using the free WinSCP which allows me to edit the files directly. It downloads and then re-uploads the file behind the scenes, so it’s quite handy for editing.
What’s next?
If you are using any kind of caching mechanism or plugin, make sure you purge it after you finish with the changes.
You may check if everything is OK by using the structured data testing tool here:
https://developers.google.com/structured-data/testing-tool/
Next, you’ll have to wait until Google re-crawls all your posts/pages. This may take between one and two weeks. As you can see in the picture above, my errors are constantly going down.
PS: This article was about the most frequent Microformats.org markup errors. Microformats.org markup is based on style classes assigned to normal HTML elements. It is entirely up to the current theme how well it is implemented.
With the advent of HTML5 a more modern markup style was born, Schema.org. Find out how to add rich snippets even if your theme does not have any structured data markup whatsoever.
PPS: I hope you enjoyed reading this post. If you liked it, please leave a comment or share it.
This is surely some great information
I use prose for Genesis so I’ll have to check this out how it’s done there. Any tips for that?
Hi, thanks for stopping by!
Unfortunately I’m not using Genesis and dind’t use it in the past neither, so I don’t know what files are involved in displaying the posts and pages. But I can give you a hint based on OptimizePress theme which I’m currently using. In my case I found the responsible files (single.php for posts and page.php for pages) in each of sub-theme folders (for instance wp-content/themes/optimizePressTheme/themes/2/). Maybe it’s similar for Genesis, better take a look.
Thanks a lot
it worked for me
Hi thanks for the solution, Just resolved the structured data error. Thanks for the help once again 🙂
Hi Thanks for your solution. Going to share it via G+ and F.
Thanks a lot, Vladimir.
I too found 10 such errors in Google Webmasters Tool. I am going to follow your solution.
Regards,
Mukesh
Nice post, i got more than 50 errors in my two website. And i resolve all after using your methods … Such a very useful …!!! Thanks
I’m glad I could help you. Have you considered switching to Genesis framework/themes? I did it like a week ago and, besides the new look, it solved the structured data issues as well, and got an improved markup in general. They are always up to date with Google’s latest requirements.
Earlier in this thread, I said I’m not using Genesis, but now I do :).
I have looked at every file in my child theme and cannot find this entry or
I looked at of the files and never fount those entries.
Can I add the suggested in the Child single.php file? if so where would I put the code?
ALSO – I ran the test before doing anything and there were no errors detected, but the errors are not the structural data page of google.
https://developers.google.com/structured-data/testing-tool/
Is it possible this is a google error?
As a general rule of thumb, when it comes to making changes to template files, the best thing is to do it in a child theme, to make them update-proof.
But, from what you are telling, the structured data test tool didn’t report any errors in your case. It simply means that in Google’s eyes your site is OK, so you don’t need to take any action.
how to fix entry title on pages containing tags & categories…?
If by fixing you mean modifying the title’s text, then you should look for an SEO related plugin. For example this one: “The SEO Framework” by Sybre Waaijer.
But if it’s related to the metadata around your titles, it’s hard to tell. It depends on how your theme’s templates are organized. It could be simply the “index.php” file, which is usually responsible for blog/tag/category listings.
Or it could be one of the “content-…php” files. Or it may be a subfolder “content” containing all these template parts.
I’m now using a customized Genesis child theme, which is coded entirely different than any theme I’ve seen so far, but it solved ALL of the structured data and SEO related problems.
I am working on a software solution and technology related blog website and google webmaster showing the same errors. This is really a nice article and helped me a lot to resolve this error from my website. Thanks for sharing
Hello thanks for the solution nice post thanks a lot it works for me