Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rich snippets and structured data #510

Closed
grappler opened this issue Jun 7, 2014 · 12 comments
Closed

Rich snippets and structured data #510

grappler opened this issue Jun 7, 2014 · 12 comments

Comments

@grappler
Copy link
Collaborator

grappler commented Jun 7, 2014

There have been a few discussions about rich snippets and structured data. #508, #457

I would like to discuss how _s supports rich snippets and structured data. _s does have some support but it is not complete.

At the moment _s partially supports microformats. Google recommends using Microdata.

According to Bing:

Schema.org, an extension of the traditional Microdata annotations covering a wide variety of data types. Although Schema.org's data types differ from the Microdata data types described on these pages, the annotation techniques described here can be applied to Schema.org annotations.

Google's Structured Data Markup Helper outputs schema.org markup.

Genesis included schema.org support last year. Yoast wrote some reasons why it is good to use schema.org

Here is infographic explaining the different structured data markup formats

Guide to Rich Snippets by BlueGlass Interactive on SEOmoz
Visual Guide to Rich Snippets on SEOmoz created by BlueGlass Interactive.

The way I see it we can provide support for:

  • articles
  • author pages

WordPress adds hentry class via post_class. So what happens when this class is added Google Structured Data Testing Tool expects all of the micorformats to be present. In the case of pages where most of the time the most of the meta data like author, date is missing as these are static pages and do not need this data. I just opened a ticket that hentryclass should only display on blog posts and thus it will create no errors on pages and any other CPT. Till the ticket is resolved we could use this code snippet so that hentry only loads if it is a post.

function _s_remove_hentry( $classes ) {
    if ( 'post' != get_post_type()) {
        $classes = array_diff( $classes, array( 'hentry' ) );
    }
    return $classes;
}
add_filter( 'post_class','_s_remove_hentry' );

Sorry for the long issue. I am not an expert in this and that is why I would like to include and reference all of the information.

@slobodan
Copy link
Contributor

slobodan commented Jun 7, 2014

I completely agree on switching to Microdata. As you said, it's recommended by Google and Bing, and I'd guess main reason for anyone to use structured data is for SEO.

Additionaly, it would be nice to use filters to make it possible to change Schema that's being used, so in CPTs, page templates etc, you could use another Schema.

@obenland
Copy link
Member

obenland commented Jun 8, 2014

At the moment _s partially supports microformats.

What's missing? Other than #508.

@emiluzelac
Copy link
Contributor

_s is not missing anything :)

Here's the test:

Extracted structured data

hatom-feed
hatom-entry:    
entry-title:    Sample Post
entry-content:  Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam nisi lorem, pulvinar id, commodo feugiat, vehicula et, mauris. Aliquam mattis porta urna. Maecenas dui neque, rhoncus sed,...
updated:    June 7, 2014
published:  June 7, 2014
author: 
fn: Emil Uzelac
person-name:    
url:    
http://example.com/author/emil-uzelac/
bookmark:   
name:   Sample Post
rel:    bookmark
url:    http://example.com/sample-post/
tags:   
name:   Tag
rel:    tag
url:    http://example.com/tag/tag/

You can test here: https://www.google.com/webmasters/tools/richsnippets no errors of any kind.

I would say that we're in acceptable stage as far as the data goes. Schema is nice, but I don't think that we would need that in a starter Theme.

Test was made with an unchanged _s version.

Bing is powered by Yahoo and Yahoo uses an outdated technology for just about anything search engine related ;)

@grappler
Copy link
Collaborator Author

grappler commented Jun 8, 2014

@obenland Support on pages with disabled comments and author archive pages.

@emiluzelac According to Bing they support all types of structured data markup.

Bing is powered by Yahoo and Yahoo uses an outdated technology for just about anything search engine related ;)

@slobodan
Copy link
Contributor

slobodan commented Jun 8, 2014

Yeah, I don't agree on Bing being all outdated either, especially on this issue.

Based on Google and Bing support, Schema is the future.

Historically, we’ve supported three different standards for structured data markup: microdata, microformats, and RDFa. Instead of having webmasters decide between competing formats, we’ve decided to focus on just one format for schema.org. In addition, a single format will improve consistency across search engines relying on the data. There are arguments to be made for preferring any of the existing standards, but we’ve found that microdata strikes a balance between the extensibility of RDFa and the simplicity of microformats, so this is the format that we’ve gone with.

https://support.google.com/webmasters/answer/1211158?hl=en

Since _s already supports one format of structured data, maybe it should be the one that is most future proof and is most widely supported.

@emiluzelac
Copy link
Contributor

Cool guys :)

@lchski
Copy link
Contributor

lchski commented Jun 30, 2014

Does a move to microdata make sense? I’d be willing to take this on as a project if so.

@obenland
Copy link
Member

Personally, I don't think it does for _s. It might make sense for a theme based on _s, but we don't have enough information about the end product to make it work really. It would also require core support IMO, which is not there.

We have a pretty good grip on Microformats, let's focus on that rather.

@philiparthurmoore
Copy link
Collaborator

I agree with @obenland and suggest that we close this out.

@glueckpress
Copy link

A typical fork/branch scenario, isn’t it?

@obenland
Copy link
Member

I agree […] and suggest that we close this out.

Let's do that then. Thanks for bringing it up @grappler!

@tommorris
Copy link

I know this issue has now closed, but I should note that it is possible to support both Microformats and RDFa (for Schema.org or whatever else one chooses). Microformats uses the class attribute to markup data, while RDFa uses its own set of attributes (property, typeof, about etc.). Interleaving both is possible (and possibly desirable given that Microformats2 is being used by people in the indieweb community to build lightweight cross-site commenting and interaction).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants