Structured Data Errors Google Search Console (Webmaster Tools)


#1

Hi!
I’ve recently started my site, running Greatmag with a child-theme.I’m having troubles with structured data in Google Search Console.Google Search Console tells me I have 3 type of structured data error on some pages
missing: updated
missing: author
missing: fn
can you please help me on this issue?

Best regards,
Krushna


#2

Hello there,

To fix it, please try adding the below PHP code to your child theme’s functions.php file. If you aren’t running a child theme, alternatively you can use a functionality plugin like Code Snippets.

    function greatmag_child_remove_hentry( $classes ) {
        if ( is_page() ) {
            $classes = array_diff( $classes, array( 'hentry' ) );
        }
        return $classes;
    }
    add_filter( 'post_class','greatmag_child_remove_hentry' ); 

Regards,
Kharis


#3

Hi!

I have a similar error in my Goggle Search Console. On all my article post, I have an error “missing: fn” for each comment posted under the article. For exemple, for an article with 15 comments, I have 15 errors “missing: fn”.

Is the code you give Kharis works as well in my case or I have an other problem?

Thanks!

Best regards,
Enora


#4

Hello Enora,

AFAIK not all pages have an .fn class. Is there any related links information reported by the Google Search Console tool?

Are you running the latest version of Greatmag?

Regards,
Kharis


#5

Hello Kharis,

Thanks for your answer. Yes I am running the latest version of Greatmag and I use a childtheme.

It seems that the error appears only for the articles with comments.

For exemple this page “https://geonautrices.com/bilan-gr-tour-du-mont-blanc/” has 15 errors of missing: fn. The errors are related to the type of data “hcard” in the GSC, source “microformats.org”. When I clicked on this line, I have the details of all articles’ links which have errors and when I clicked on an article on the list, I have the details of the data detected “hcard” with “itemtype” and “photo” for each hcard. There is as much hcard data as comments in the article.
And that’s it. I don’t know if these informations could help you to see the problem.

I tried to check the tool for testing structured data of GSC as well but there isn’t errors detected…

Thank you for your help and your time, I appreciate it ! :slight_smile: (and happy new year :wink: ! )

Enora