Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

add "updated" to hNews microformat to support Google structured data #948

Closed
wants to merge 1 commit into from

6 participants

@kevinlisota

Google's structured data testing tool requires that hentry items are
tagged with an "updated time". This fix will remove the "missing
required field updated" error in Webmaster Tools and the Structured Data
Testing Tool

@kevinlisota kevinlisota add "updated" to byline microformat to support Google structured data
Google's structured data testing tool requires that hentry items are
tagged with an "updated time". This fix will remove the "missing
required field updated" error in Webmaster Tools and the Structured Data
Testing Tool
369b8a6
@Foxaii
Collaborator

The date the post was published, could be different from the date the post was updated. So I'm not sure if we should be combining the two together by default.

Thanks for raising it though as it's worth further investigation.

@kevinlisota

True. Setting the both to the same time is a pretty common solution to this microformat error in the WP community. Whether it is technically correct or not is another matter. I could be convinced that the vast majority of WP post are never modified after publish, making it irrelevant. I also think that having both times visible to the reader is meaningless and repetitive in most contexts.

That said, I implemented this differently on my own site to make the two times correct. I've hidden the updated time using the Bootstrap hidden class, since it didn't make sense to show it to the reader.

<time class="published" datetime="<?php echo get_the_time('c'); ?>"><?php echo get_the_date(); ?></time>
<time class="updated hidden" datetime="<?php echo get_the_modified_time('c');?>"><?php echo get_the_modified_date()?></time>
@Foxaii
Collaborator

Displaying both dates as a string is a definite no. Having a "Last edited %n days ago" string with the updated class was my initial thought.

@toddsantoro

@kevinlisota This is exactly what I did and it fixed my WebMaster Tools errors. This is why I love the Roots Framework because it is so cutting edge.

@webdesignphilippines

I'm tempted to hide 'updated' in an itemprop meta. It becomes invisible to human eyes only. I got it to work but took it out again. Is this legit or would i get penalized by google?

@retlehs
Owner

i tweeted readability about this and they said they'd reply on my gist, still waiting for a reply

@retlehs retlehs added the on hold label
@retlehs
Owner

probably safe to say that they're not gonna give any input. i've tweeted em once or twice after the first one and so did @JulienMelissas

@JulienMelissas
Collaborator

Yep I was trying to help get some old issues closed.

@retlehs
Owner

closed by 08104ea

@retlehs retlehs closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 21, 2013
  1. @kevinlisota

    add "updated" to byline microformat to support Google structured data

    kevinlisota authored
    Google's structured data testing tool requires that hentry items are
    tagged with an "updated time". This fix will remove the "missing
    required field updated" error in Webmaster Tools and the Structured Data
    Testing Tool
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  templates/entry-meta.php
View
2  templates/entry-meta.php
@@ -1,2 +1,2 @@
-<time class="published" datetime="<?php echo get_the_time('c'); ?>"><?php echo get_the_date(); ?></time>
+<time class="published updated" datetime="<?php echo get_the_time('c'); ?>"><?php echo get_the_date(); ?></time>
<p class="byline author vcard"><?php echo __('By', 'roots'); ?> <a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>" rel="author" class="fn"><?php echo get_the_author(); ?></a></p>
Something went wrong with that request. Please try again.