Google Structured Data erros

Home Forums Accelerate Pro Google Structured Data erros

This topic contains 7 replies, has 2 voices, and was last updated by  Bipin Singh 3 years, 5 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1228892

    Adam
    Participant

    In Google Search Console > Search Appearance > Structured Data > hatom, there are a number of errors including missing: author and missing: updated. Google searches around this topic indicate this could be a theme error and to contact the theme developer for a permanent fix. Has the issue been updated in Accelerate Pro? What can I do to resolve the errors?

    #1229012

    Bipin Singh
    Moderator

    Hi Adam,

    If you had tested for page than it’s obvious to show errors like missing: author, update because those things are not required on the pages. Author, update are only required for posts. If those errors are showing for posts than let us know but you can ignore those.

    Thank you
    ThemeGrill Support Team.

    #1229168

    Adam
    Participant

    Understand the author, update are only needed for posts, however Google doesn’t read them that way. Google is showing the errors and won’t ignore them. Is there a plugin or other code that would tell Google to ignore?

    #1229263

    Bipin Singh
    Moderator

    Hi Adam,

    Google show same error for other site too, as in all the WordPress sites, page do not have any of those meta. We can ignore those and I hope it won’t effect much.
    I don’t know of such plugins but you can search in WordPress Plugin directory, here’s the link: https://wordpress.org/plugins/

    Regards,
    ThemeGrill Support Team.

    #1229460

    Adam
    Participant

    Thanks. I found this article describing code to add to the single.php file in the theme: https://wordpress.org/support/topic/google-structured-data-missing-required-field-authorship-thumbnails-gone/page/2

    Can I add the code below to a file in the Accelerate Pro theme? If so, which file? I see a content-single.php file but no single.php.

    //mod content
    function hatom_mod_post_content ($content) {
    if ( in_the_loop() && !is_page() ) {
    $content = ‘<span class=”entry-content”>’.$content.'</span>’;
    }
    return $content;
    }
    add_filter( ‘the_content’, ‘hatom_mod_post_content’);

    //add hatom data
    function add_mod_hatom_data($content) {
    $t = get_the_modified_time(‘F jS, Y’);
    $author = get_the_author();
    $title = get_the_title();
    if ( is_single() || is_page()) {
    $content .= ‘<div class=”hatom-extra”><span class=”entry-title”>’.$title.'</span> was last modified: <span class=”updated”> ‘.$t.'</span> by <span class=”author vcard”><span class=”fn”>’.$author.'</span></span></div>’;
    }
    return $content;
    }
    add_filter(‘the_content’, ‘add_mod_hatom_data’);

    #1229492

    Bipin Singh
    Moderator

    Hi Adam,

    If you had observed than all those missing/errors will generate only for pages (as page do not have author and date) but not for the posts. We have already include all those required things for posts in the Theme already.

    Anyway, if you want to give a try than create the child theme and paste it in the functions.php file of the child theme.
    I have changed it, you can try this code instead:

    add_filter( 'the_content', 'hatom_mod_post_content');
    
    //add hatom data
    function add_mod_hatom_data($content) {
    $t = get_the_modified_time('F jS, Y');
    $author = get_the_author();
    
    if ( is_page() ) {
    $content .= '<div class="hatom-extra"><span class="updated"> '.$t.'</span> <span class="author vcard"><span class="fn">'.$author.'</span></span></div>';
    }
    return $content;
    }
    add_filter('the_content', 'add_mod_hatom_data')

    Also, paste the following code, to hide it, in Custom CSS Box in Customize panel:

    .hatom-extra{
    display: none;
    }

    Thank you.
    ThemeGrill Support Team.

    #1229539

    Adam
    Participant

    Thanks, I am testing this plugin first: https://gumroad.com/l/hatom-plugin#

    #1229673

    Bipin Singh
    Moderator

    Great.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.