• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Google rich snippet – Warning

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Google rich snippet – Warning

This topic is: not resolved

Tagged: rich snippet warning

  • This topic has 1 reply, 2 voices, and was last updated 12 years, 10 months ago by cehwitham.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • January 10, 2013 at 5:55 am #10917
    mariafernandez
    Member

    In order to get rid of the “Warning: Missing required field “updated”.” in the Google Webmaster Structured Data Testing Tool, I've added the code below to my functions.php file (Balance theme). Unfortunately, it has also added a second ‘By Maria Fernandez” line to all my posts, as well as the date and  “Updated: <date>”. These new lines make my blog unsightly.

    Is there a way I can modify the code below so that I can remove the Warning without adding the date, “By <author>” and “Updated” lines?

    My blog is: http://www.spanish-bites.com/

    -----

    remove_action( 'genesis_before_post_content', 'genesis_post_info' );

    add_action( 'genesis_before_post_content', 'child_post_info' );

    function child_post_info() {

    if ( is_page() )

    return; // don't do post-info on pages ?>

    <div class="post-info">

    <span class="date published time">

    <time class="entry-date" itemprop="startDate" datetime="<?php echo get_the_date( 'c' ); ?>" pubdate><?php echo get_the_date(); ?></time>

    </span> By

    <span class="author vcard">

    <a class="fn n" href="<?php echo get_the_author_url( get_the_author_meta( 'ID' ) ); ?>" title="View <?php echo get_the_author(); ?>'s Profile" rel="author me"><?php the_author_meta( 'display_name' ); ?></a>

    </span>

    <span class="post-comments">&middot; <a href="<?php the_permalink() ?>#comments"><?php comments_number( 'Leave a Comment', '1 Comment', '% Comments' ); ?></a></span>

    <?php // if the post has been modified, display the modified date

    $published = get_the_date( 'F j, Y' );

    $modified = the_modified_date( 'F j, Y', '', '', FALSE );

    $published_compare = get_the_date( 'Y-m-d' );

    $modified_compare = the_modified_date( 'Y-m-d', '', '', FALSE );

    if ( $published_compare < $modified_compare ) {

    echo '<span class="updated"><em>&middot; (Updated: ' . $modified . ')</em></span>';

    } ?>

    </div>

    <?php }

    -----------------

    February 18, 2013 at 3:44 am #20945
    cehwitham
    Participant

    Hi Maria,

    I can't see the dates outputting on your site.

    Could you just add the updated class to the published date? Would that satisfy Google?

    Alternatively if Google / your requirements need both dates but you only want to show one of them, I think you'd be forced to hide the second one with CSS.

    Chris


    Twitter: cehwitham Web: cehwitham.com

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble