• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Problem with Schema with Genesis 2.2

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Problem with Schema with Genesis 2.2

This topic is: not resolved

Tagged: Genesis 2.2, schema

  • This topic has 38 replies, 10 voices, and was last updated 10 years, 7 months ago by jamesjd7.
Viewing 19 posts - 21 through 39 (of 39 total)
← 1 2
  • Author
    Posts
  • September 4, 2015 at 10:06 am #164584
    David Chu
    Participant

    Hi JS,
    I've become the de facto guy around here for playing with attributes. ๐Ÿ™‚ You can indeed add or change attribute items on the HEAD tag. Here's an example.

    btw, this feature has been there for quite awhile, you can alter or add attributes all over a webpage. It's just that most people don't mess with attributes that much. Look in \lib\functions\markup.php in the framework to see all the possibilities.

    Thanks, Dave


    Dave Chu ยท Custom WordPress Developer – likes collaborating with Designers

    September 4, 2015 at 1:05 pm #164602
    emmtre
    Participant

    Nathan found the cause of the problem with the error message and the strange microdata markup.

    <main class="content" role="main" itemprop="mainContentOfPage" itemscope="itemscope" itemtype="http://schema.org/Blog">

    The Microdata Manager plugin by Brad Potter is not compatible with the new Gensis 2.2 version.

    September 4, 2015 at 10:36 pm #164638
    Brad
    Member

    Uh Oh, what broke? That was my very first plugin so it likely needs improving.

    September 5, 2015 at 3:27 am #164648
    emmtre
    Participant

    Brad, when the plugin is activeted it ads some microdata to the class="content" which give errors with Google's structured data testing tool.

    <main class="content" role="main" itemprop="mainContentOfPage" itemscope="itemscope" itemtype="http://schema.org/Blog">

    Google doesn't recognize the property mainContentOfPage for an object of type Blog.

    Any plans to update the plugin? I've been using it to easily add microdata markup like AboutPage or ContactPage to improve search results.

    September 5, 2015 at 8:03 am #164660
    Nathan Rice
    Member

    @Brad
    I think you need to try to modify the classes ONLY when they need to be modified. If you have a GH repo for this plugin, I'd be happy to try to submit a PR for this.

    September 5, 2015 at 1:27 pm #164678
    Brad
    Member

    @Nathan-Rice
    Very kind offer and I would appreciate that very much. I've looked at what I wrote 2 years ago (with assistance from Gary) and I'm scratching my head wondering what to do!

    I was looking at markup.php and it seems like a lot of changes have happened. My summer break is over and I'm back at my full-time job so I welcome any PRs.

    https://github.com/bradpotter/microdata-manager

    September 5, 2015 at 4:36 pm #164696
    emmtre
    Participant

    Nathan,

    I found another possible markup issue. For normal pages this markup is added.

    <div class="content-sidebar-wrap">
    <main class="content" itemprop="mainContentOfPage">

    But mainContentOfPage is only supposed to be used on schema.org/WebPageElement (and it's sub-classes).

    So the breadcrumb markup for pages is't recognized as a normal BreadcrumbList by Google's testing tool.

    And the whole webpage content is now interpreted as the name of the mainContentOfPage.

    September 5, 2015 at 6:14 pm #164708
    Nathan Rice
    Member

    Wow, good catch. Looks like we're using that property all wrong. In fact, we probably shouldn't be using it at all. I'll fix it.

    September 6, 2015 at 12:42 am #164718
    emmtre
    Participant

    Nathan,

    I installed the develop version from GitHub and it looks better. But I'm not sure we are there yet. The breadcrumbs are now recognized as part of the WebPage for normal pages. But for blog, archive, single post pages, etc the breadcrumbs are recognized as an explicit BreadcrumbList. I don't know if it will have an impact or not. I'll send you an email with some test results to illustrate.

    Did you see my other email? The BlogPosting markup is now missing for posts on the front page, blog page set for displaying posts and when using the blog template. Meta and author still get the right markup even if BlogPosting is missing on these pages. The BlogPosting markup is still there and correct for posts in archive and single post pages. I think this is the way the markup should look for all posts.

    <article class="post type-post status-publish format-standard has-post-thumbnail entry" itemscope itemtype="http://schema.org/BlogPosting" itemprop="blogPost">

    September 6, 2015 at 5:08 am #164724
    cruisegle
    Member

    It almost seems that depending on the theme you are using or the Schema (local business etc) you are using; issues arise when you use the testing tool.

    Generally I start by testing a design with the testing tool and then remove any ones that throw up faults and correct them in my functions folder.

    Some sites require a bit of manipulation.

    This is not really a Genesis issue; maybe my own as I want sites to work how I want them to work.

    Great input @emmtre


    I’m an SEO Consultant by trade; who is getting by; just!

    September 6, 2015 at 10:06 am #164748
    Nathan Rice
    Member

    @emmtre
    I'll paste my email content here for others to see, RE: breadcrumbs:

    That's right ... but I think that's the way it's supposed to be.

    The difference is that on pages (anything that doesn't get a schema.org/Blog type), itemprop="breadcrumb" isn't valid. So we have a conditional that unsets it. My guess is that when this itemprop is missing, the BreadcrumbList gets orphaned back to a top level element, rather than a sub-element of WebPage.

    I'm not sure which is preferred, but breadcrumbs are a relatively new to Schema.org, so I imagine they'll get that worked out at some point. 2.1.x had no support for Breadcrumb lists, so 2.2 is a positive step, even if it's not necessarily perfect.

    ===

    As for the BlogPosting issue, this happens for any use of the blog page template, and I believe the reason is that the query we do for posts is not the main query. We have a conditional in our filter that prevents schema from being added to posts that aren't part of the main query (for various reasons).

    I'm honestly inclined to not worry about this. We want to discourage the use of that page template anyway, and if I can manage it, I'll get rid of it completely.

    September 6, 2015 at 10:37 am #164750
    emmtre
    Participant

    Nathan,

    Yes but it's not only for the blog template pages. The BlogPosting markup is also missing for posts on the front page and the blog page set for displaying posts in WordPress settings. And since it's working in 2.2.0 something must have changed in the 2.2.1 version. I think it still needs to be there at least for backward compatible reasons and not to penalize websites that still use the blog template.

    September 7, 2015 at 8:56 am #164835
    macrunner
    Participant

    I have read that it will be released version 2.2.1
    it is possible to estimate, even approximate, on the release date of this new version?

    Thanks

    September 10, 2015 at 7:39 pm #165182
    chardp
    Member

    I am having a related issue where I am not getting itemprop="image" on any images on a single post page and these are one i am indexing. I've been playing around trying to fix this to no luck. It adds it fine on the homepage images, but I cannot get it to work on single.

    Has anyone else had this issue? I don't know if this is new or not. I only just stumbled upon the error that I am missing an image when using the structured data testing tool

    September 11, 2015 at 8:34 am #165216
    Nathan Rice
    Member

    @chardp

    Images that are inserted into the content of a post will need to have that property added manually. Genesis doesn't generate the markup for anything in the post content, so that bit is up to you.

    September 11, 2015 at 4:20 pm #165257
    chardp
    Member

    Hmm I never knew that if that has always been the case. No wonder none of my results in google had images.

    I thought this might be the case for images inserted into the content, but I was surprised that it wasn't there for the featured image, or couldn't be done programmatically.

    September 11, 2015 at 5:52 pm #165259
    emmtre
    Participant

    It can be done in different ways depending on your child theme and how images are displayed. You can also use the genesis_attr_entry-image filter to add attributes.

    if ( is_single() ) {
    	the_post_thumbnail('large', array('class' => 'alignleft post-image entry-image', 'itemprop' => 'image'));
    }
    add_filter( 'genesis_attr_entry-image', add_image_markup' );
    function add_image_markup( $attributes ) {
    	$attributes['itemprop'] = 'image';
    	return $attributes;
    }
    September 12, 2015 at 7:31 am #165278
    Victor Font
    Moderator

    Here's code that will add itemprop="image" to all the images found within post or page content. I've tested this in my local environment with Outreach pro.

    // add itemprop image markup to img tags
    add_filter('the_content', 'vmf_add_itemprop_image_markup', 2);
    function vmf_add_itemprop_image_markup($content)
    {
    	//Replace the instance with the itemprop image markup.
    	$string = '<img';
    	$replace = '<img itemprop="image"';
    	$content = str_replace( $string, $replace, $content);
    	return $content;
    }

    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    December 11, 2015 at 3:54 pm #173561
    jamesjd7
    Participant

    I'm having structured data errors with my install. See screen shots. if anyone can help, that would be greatly appreciated.

    see links.

    https://www.dropbox.com/s/f33ffp21q27q3xa/StructuredDataErrorDateModified.png?dl=0

    https://www.dropbox.com/s/bsbbge0qtbb1ejb/StructuredDataErrorImage.png?dl=0

    https://www.dropbox.com/s/fje5to0zeg4ewog/StructuredDataErrorMainEntityOfPage.png?dl=0

    https://www.dropbox.com/s/fje5to0zeg4ewog/StructuredDataErrorMainEntityOfPage.png?dl=0

  • Author
    Posts
Viewing 19 posts - 21 through 39 (of 39 total)
← 1 2
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble