WordPress.org

Forums

Rich Snippets Error Missing required field "updated" (2 posts)

  1. moonlitknight
    Member
    Posted 3 years ago #

    I am using a theme based on Twenty Eleven Version: 1.4
    It fails the Google Rich Snippets testing tool on only one point - Warning: Missing required field "updated".

    I think the problem is in

    function twentyeleven_posted_on() {
    	printf( __( '<span class="sep">Posted on </span><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'twentyeleven' ),
    		esc_url( get_permalink() ),
    		esc_attr( get_the_time() ),
    		esc_attr( get_the_date( 'c' ) ),
    		esc_html( get_the_date() ),
    		esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    		esc_attr( sprintf( __( 'View all posts by %s', 'twentyeleven' ), get_the_author() ) ),
    		get_the_author()
    	);

    My tentative solution is to change time class="entry-date" to time class="updated" but I am not sure if doing this would badly effect anything else - was it named entry-date for a reason that I am ignorant of?

    Replies and comments would be much appreciated.

  2. Daniel Marquard
    Member
    Posted 2 years ago #

    Hi moonlitknight...I found your post while searching for a solution myself. Your snippet was helpful in determining how best to fix this.

    To answer your question, you can use multiple classes by replacing <time class="entry-date" with <time class="entry-date updated". I've created a tutorial to assist others with making this change.

    Thanks again.

    http://www.technosultants.com/blog/warning-missing-required-field-updated-wordpress

Topic Closed

This topic has been closed to new replies.

About this Topic