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

Audit the use of Schema.org markup #296

Open
christophherr opened this issue Jun 28, 2018 · 4 comments
Open

Audit the use of Schema.org markup #296

christophherr opened this issue Jun 28, 2018 · 4 comments
Assignees
Projects
Milestone

Comments

@christophherr
Copy link
Member

There have been changes to the Schema.org vocabulary since Schema markup was added to Beans.
WebPage has gotten "stricter" and Google's Schema validator is showing errors and warnings (I only tested blog posts and blog archives)

It would also be interesting to explore the possibility of removing the "hard-coded" Schema from our templates and moving to JSON-LD instead.

@iCaspar
Copy link
Contributor

iCaspar commented Jun 28, 2018

+1 for moving to JSON-LD

@hellofromtonya hellofromtonya added this to Planning and Organization in V1.6 via automation Jul 3, 2018
@hellofromtonya
Copy link
Contributor

@christophherr Can you take this audit on please? Let's include it in the v1.6 release. It'll be good to have a consistent approach.

@christophherr
Copy link
Member Author

Errors/warnings shown in the structured markup testing tool:

screen shot at july 4th 2018 - 12 44 06 pm 1 25x

We could

Change our post interface to add a publisher field and show a warning/error message when a post is being saved without image or publisher.

Change the Schema.org markup in Beans.
The quick fix would be to remove the 'blogPosting' specific attributes from https://github.com/Getbeans/Beans/blob/development/lib/templates/structure/loop.php#L41
and change articleBody to text in https://github.com/Getbeans/Beans/blob/development/lib/templates/structure/loop.php#L66

Adding this code snippet to your child theme's functions.php simulates that:

beans_replace_attribute( 'beans_post', 'itemtype', 'https://schema.org/BlogPosting', 'https://schema.org/CreativeWork' );
beans_remove_attribute( 'beans_post', 'itemprop' );
beans_replace_attribute( 'beans_post_body', 'itemprop', 'articleBody', 'text' );

A change like this has to be tested really well.
We don't want to negatively impact the search result output of existing websites.

Explore alternatives

Beans is adding Schema.org related markup to 23 hooks.

While not necessarily all/a lot of the default output would have to be changed for different Schema.org vocabularies (e.g. products, event, localbusiness, restaurant...), it's not very intuitive or flexible.
I am also not sure how well Beans is integrating with existing Schema plugins.

  • Moving to JSON-LD might be an alternative. This is how SEO plugins (e.g. Yoast) and Schema plugins add structured data.
    For anybody interested in exploring JSON-LD, here is a plugin to remove the Beans Schema output, so we don't have to rip apart Beans to start testing.
  • Just so it has been mentioned, we could also remove Schema.org markup completely and recommend using dedicated Schema plugins.

@hellofromtonya hellofromtonya added this to the v1.6 milestone Jul 6, 2018
@christophherr
Copy link
Member Author

For the record, I think, until we decide on an overall Schema strategy, we should

remove the 'blogPosting' specific attributes from https://github.com/Getbeans/Beans/blob/development/lib/templates/structure/loop.php#L41
and change articleBody to text in https://github.com/Getbeans/Beans/blob/development/lib/templates/structure/loop.php#L66

for the next/1.6 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
V1.6
  
Planning and Organization
Development

No branches or pull requests

4 participants