SEO tip: Fix hentry errors in Google Webmaster Tools

If you are using WordPress, you could be hindering your SEO with invalid structured data.

To quickly find out if you are getting hentry errors, log into Google Webmaster Tools and look at “Search Appearance” > “Structured Data”.

Structured Data tool in Google Webmaster Tools

hentry errors in Google Webmaster ToolsLook at the data type ‘hentry’. Are you getting errors? Then read on for the fix!

(NB: in the Google Structured Data Testing Tool this does not show up as an error!)

About hentry: here be content

“hentry” is a class that is added automatically by WordPress to the block on your page that contains the post. It is part of the hAtom specification, and indicates to search engines that there is content that can be syndicated. In other words: ‘this block contains an article that can be displayed in feeds‘.

In order for search engines and other bots to extract the article, they need to find at least the title, content, author and publishing date. These are indicated by their own classes ( entry-title, entry-content, author, and published respectively).

Most themes will use the classes above to indicate to bots what piece of content is what exactly, so they can read the page more easily.

The problem

The fields listed above are required for a hentry to be parsed. But Pages generally don’t display the author and published date!

WordPress adds the hentry class automatically when the theme uses post_class(), regardless of post type. Some theme authors refrain from using post_class() for post types that are not blog posts, others use the trick below to prevent hentry to be added to Pages.

If you are getting the error, your theme probably does no such thing!

The solution

The solution is to disable hentry altogether for post types that do no sport an author or date.

Add the following snippet to your child theme functions.php or your functions plugin:

 * Only use 'hentry' for post types with author and published date
function remaintenance_remove_hentry( $classes, $class, $post_id ) {
    $hentry_post_types = array(

    $post_type = get_post_type( $post_id );

    if ( !in_array( $post_type, $hentry_post_types ) ) {
        $classes = array_diff( $classes, array( 'hentry' ) );

    return $classes;
add_filter( 'post_class', 'remaintenance_remove_hentry', 10, 3 );

You can add extra post types to $hentry_post_types to add hentry to other post types too.

Getting errors for blogs too?

If you are getting the error for blogs too, that means that the author and published classes are not added to posts! To fix this, you can disable hentry for posts as well, by remove post from $hentry_post_types in the above snippet.

Alternatively, you can fix your (child)theme by adding the author and published classes to your single.php.

Don’t want to worry about how WordPress internals hinder your SEO performance? Then have a look at Remaintenance! We will pro-actively monitor your website for any performance and SEO issues, and solve things as they come up, so you can focus on your content.

  • Dovid de Bresser
    Posted at 05:56h, 28 August Reply

    How to add author etc. to pages in the Twenty Fourteen theme?

  • cara
    Posted at 15:41h, 25 October Reply

    done with folow this article… thanks…

  • brihaspathi
    Posted at 01:09h, 20 November Reply

    you are saying solution is for wordpress i want to know about blogger please give solution for solving structured data errors in blogger.

  • lenovo service
    Posted at 23:53h, 03 February Reply

    Hi friend, Im also getting this error, I tried but i couldn’t solve. Can you tell the solution for me.

    Structured Data
    Status: 1/28/17
    31 Items with Errors
    on 17 pages

    Data Type Source Pages Items Items with Errors
    hentry Markup: 17 31 31
    LaptopStore Markup: 67 67 –
    LaptopShop Markup: 11 11 –
    WebSite Markup: 1 11 –
    hcard Markup: 1 11 –

    Lenovo Service

  • Aditi Aggarwal
    Posted at 00:29h, 06 June Reply

    thanks for sharing great article with us. it is very help ful for me.

  • Praveen
    Posted at 15:35h, 27 July Reply

    Very nice article, helped me a lot, thanks for sharing,what about my website: , will try its best to bring high quality blogs which can help working employees like you to start your online business initially with out quitting your job and then be your own boss as your business grows.

  • Harsh Mishra
    Posted at 05:10h, 02 August Reply

    Can you tell me how to do it in blogger blogs?

  • simran
    Posted at 17:00h, 19 September Reply

    where to add author in single.php

  • Techjockey Software
    Posted at 02:36h, 26 September Reply

    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…

  • Jim Sanders
    Posted at 18:52h, 17 October Reply

    Thanks for sharing you ideas with us.

  • Tony
    Posted at 10:19h, 22 November Reply

    Its very useful, I was able to fix one of blog. Thanks for sharing the nice article .

  • Rancah Post
    Posted at 23:52h, 25 November Reply

    I got huge items with error in structured data, unfortunately i’m not familiar with coding, Any help?

  • Viral Telecast
    Posted at 03:07h, 15 January Reply

    Hello, I changed hentry and authour code in single.php but again it’s showing errors. when I doing testing on google webmaster then they are showing it is correct but again and again structure data are showing missing entry-title and missing author. how can I solve it?

  • Aminul Islam
    Posted at 03:41h, 16 January Reply

    Is there any way to fix Hentry or hatom errors with any plugin??

  • سمپاشی
    Posted at 03:19h, 04 February Reply

    I have the same problem !
    and the offered solution didn’t solve that !

  • Harsh
    Posted at 22:08h, 14 March Reply

    Really, Very useful and informative article! Thanks for sharing such a wonderful article.

  • GovtJobAlertIndia
    Posted at 03:26h, 25 August Reply

    As my blog is in blogspot then how do i solve it.
    Missing: author
    Missing: updated
    There is showing 22 error. I am new in coding so tell me easy way to solve it and also tell if any plugin for blogger.

  • Sonam Agarwal
    Posted at 23:48h, 12 March Reply

    Hi, thanks for your suggestions. I will ensure to use these tips. Keep sharing…

  • Rashi
    Posted at 01:46h, 13 March Reply

    Extremely like your blog content the manner in which you put up the things… I’ve read the subject with incredible intrigue and certainly will adhere to your blog routinely for other extraordinary posts.

Post A Comment