Beans icon indicating copy to clipboard operation
Beans copied to clipboard

Audit the use of Schema.org markup

Open christophherr opened this issue 7 years ago • 4 comments

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.

christophherr avatar Jun 28 '18 19:06 christophherr

+1 for moving to JSON-LD

iCaspar avatar Jun 28 '18 20:06 iCaspar

@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.

hellofromtonya avatar Jul 03 '18 16:07 hellofromtonya

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.

christophherr avatar Jul 04 '18 17:07 christophherr

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.

christophherr avatar Sep 09 '18 23:09 christophherr