WordPress.org

Make WordPress Core

Opened 6 years ago

Last modified 19 months ago

#26723 reopened defect (bug)

Hatom Errors

Reported by: fidosysop Owned by:
Milestone: Future Release Priority: low
Severity: normal Version: 3.8
Component: Bundled Theme Keywords: needs-patch
Focuses: template Cc:

Description

Greetings.

Getting this on Google's Structured Data Testing tool.

Extracted structured data
hatom-feed
hatom-entry:
Error: At least one field must be set for HatomEntry.
Error: Missing required field "entry-title".
Error: Missing required field "updated".
Error: Missing required hCard "author".

The 1st two are caused by using WordPress with a static home page, this started with the 3.8 release. I am using a theme designed in Artisteer that worked fine before the 3.8 release. Artisteer is no help pointing the finger at WordPress. Activating WP 2014 theme solves the 1st 2 errors but the below still shows.

Error: Missing required field "updated".
Error: Missing required hCard "author".

The second two have been present showing as "Warnings" in self hosted WordPress sites for a long time. However since a recent Google algorithm chance those warnings are now Errors. An announcement from Google.
http://googlewebmastercentral.blogspot.com/2013/12/structured-data-dashboard-new-markup_12.html

Below is a screen shot of one of my sites Google webmaster tools accounts. http://www.doc1952.com/hatom-errors.jpg

All of my sites structured data thumbnails have disappeared from search results. I have posted about this situation in the WordPress forums with no help so far.
http://wordpress.org/support/topic/google-structured-data-missing-required-field-authorship-thumbnails-gone?replies=10

Thanks for your help with this.

Ed Koon
www.doc2014.com

Attachments (1)

26723.diff (3.9 KB) - added by slobodanmanic 5 years ago.

Download all attachments as: .zip

Change History (22)

#1 @rmccue
6 years ago

  • Component changed from General to Bundled Theme

The first set of errors are entirely up to your theme, so we can't do much about that.

However, we can look at the errors in Twenty Fourteen, since it's bundled. :)

#3 @fidosysop
6 years ago

  • Cc fidosysop@… added

I set this site up to test a stock WordPress 3.8 install for structured data compliance: www.fidosysop.com All 3 themes that are included in the WordPress install package are failing the test with these two errors.

Error: Missing required field "updated".
Error: Missing required hCard "author".

I'm thinking this is a core WordPress fault at this point.

Happy New Years Everyone :)

Ed Koon

#4 @obenland
6 years ago

Interesting ticket. Let's look at the attributes one by one:

updated:
This would be fairly easy to achieve, some projects provide support for it out of the box, but it would add more complexity to the post meta template tag.

entry-title:
We're missing that one on formatted posts where we don't display a title. I suppose we could print the markup and hide it on formatted posts that have a title set.

author:
This error shows up on all featured posts in Twenty Fourteen, since we do not display author information here. Solution would be similar to entry-title.

#5 @lancewillett
6 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release
  • Priority changed from normal to low

#6 @lancewillett
6 years ago

  • Milestone Future Release deleted
  • Status changed from new to closed

Anyone want to patch this ticket?

#7 @lancewillett
6 years ago

  • Milestone set to Future Release
  • Status changed from closed to reopened

#8 @slobodanmanic
5 years ago

@lancewillett I'd like to give this a try. Been intimidated by Trac for way too long, but finally found a ticket I understand. What @obenland suggested makes perfect sense.

entry-title fix should also include links Links Ephemera widget.

#9 @lancewillett
5 years ago

  • Focuses template added
  • Milestone changed from Future Release to 4.0

Cool, happy to test and review a patch once you are ready.

#10 @slobodanmanic
5 years ago

@lancewillett I appreciate that. Working on the patch today.

@obenland I noticed something weird when testing markup with Google Structured Data Testing Too:

  • Adding updated class to a new <time> element, the way _s does not fix Error: Missing required field "updated"
  • Adding updated class to existing <time> element makes the error go away (I know that's a hack and not the way to go, because we still need two <time> elements)
  • The weirdest one for me, removing <time> element that has published class does not cause any new errors

All these edits made to twentyfourteen_posted_on() function. I'll keep working on it.

Edit: Never mind, I think I got it, will upload patch later today.

Last edited 5 years ago by slobodanmanic (previous) (diff)

@slobodanmanic
5 years ago

#11 @slobodanmanic
5 years ago

According to http://microformats.org/wiki/hentry if there is no "updated", then "published" should be used, if present:

if there is no Entry Updated element,
use the Entry Published element, if present
otherwise the page is invalid hAtom

So, in twentyfourteen_posted_on this patch adds "updated" class to "entry-date" <time> element if updated time is not the same as published, otherwise it creates new <time> element with "updated" class.

A few other updates, switched meta display in Ephemera widget to use twentyfourteen_posted_on (the code used in widgets.php was identical to template tag function) and also added twentyfourteen_posted_on to posts in featured-content.php template part.

Also CSS updates to hide added "updated" and "entry-title" (in Links Ephemera widget) elements.

P.S. 2013 and 2012 have the same problem with "updated", so if this patch is OK I'd like to work on those as well.
It all validates now: http://www.google.com/webmasters/tools/richsnippets?q=http%3A%2F%2Fagilepixels.com%2F

Last edited 5 years ago by slobodanmanic (previous) (diff)

This ticket was mentioned in IRC in #wordpress-themes by obenland. View the logs.


5 years ago

#13 @obenland
5 years ago

  • Milestone changed from 4.0 to Future Release

Worthwhile effort but it's too soon for 4.0. Let's keep working on it.

#14 follow-up: @slobodanmanic
5 years ago

@obenland I don't understand this one, could you help:

https://irclogs.wordpress.org/chanlog.php?channel=wordpress-themes&day=2014-07-11&sort=asc#m102161

Why does the_title( '<h1 class="entry-title">', '</h1>' ) need to be <h1 class="entry-title"><?php the_title(); ?></h1> for this ticket?

#15 in reply to: ↑ 14 @obenland
5 years ago

Replying to slobodanmanic:

Why does the_title( '<h1 class="entry-title">', '</h1>' ) need to be <h1 class="entry-title"><?php the_title(); ?></h1> for this ticket?

If the tags are passed to the_title(), they will not be rendered if the title is empty. Since we always need them to satisfy the parser, we'd have to pull them out of the function.

#16 @slobodanmanic
5 years ago

@obenland thanks.

Just tested this and having empty tags still makes it invalid.

<h1 class="entry-title"><a href="http://wordpress.svn/?p=565" rel="bookmark"></a></h1>

That results in Error: Missing required field "entry-title" which is the same as if the tags didn't exist. But I don't think we should worry about this, if you don't have a title then a parser that requires titles is going to say your page is invalid, I'd expect it to say that.

I'll gladly keep working on this ticket, but the title issue seems to be fine as it is.

Google's tool says comment markup is also invalid, but I don't think it can be fixed, since it would require introducing new fields in comment form. We could (and probably shouldn't) use URL field for organization, but there's nothing for location or role.

This is only invalid according to Google (https://support.google.com/webmasters/answer/146646?hl=en), hCard definition (http://microformats.org/wiki/hcard#Property_List) has different required rules.

http://f.cl.ly/items/3a0x0F2L0Z062l1c1B0F/Screen%20Shot%202014-08-01%20at%2011.31.35%20AM.png

#17 @edkoon
5 years ago

This mod was needed to pass authorship testing and be eligible for the program. I design my themes in Artisteer but got the same errors in wp 2014. Google has slashed it's authorship program. They removed all the thumbnails and circles. All that shows now is the author name.
http://www.docsplace.org/blog/377/02/fixing-broken-structured-data-elements-in-artisteer-themes/

This ticket was mentioned in Slack in #core-themes by lancewillett. View the logs.


5 years ago

#19 @karmatosed
4 years ago

#32317 was marked as a duplicate.

Note: See TracTickets for help on using tickets.