Yoast seo 11.0 and Genesis Built-in Schema

New Yoast plugin is adding its schema markup. Now should we remove genesis built-in schema? More Details.

2 Likes

Impressed with Yoast SEO after this update :heart_eyes:

1 Like

It means we have to remove Genesis Schema? @GulshanKumar ?

Yes, you should.

Can we add Review, AggregateReview and other type of schema with Article schema?
Also, yoast isn’t adding Wp-header, wp-sidebar etc…what about that?

That’s doesn’t seems important …

1 Like

Yes, you can via JSON-LD markup. I have published a guide on this.

1 Like

Yes, you should do it to avoid any markup error.

/**
 * Disable Genesis Schema
 *
 * @package      EAGenesisChild
 * @author       Bill Erickson
 * @since        1.0.0
 * @license      GPL-2.0+
 */

add_action( 'init', 'be_disable_genesis_schema' );
/**
 * Disable Genesis Schema
 * @author Bill Erickson
 * @see https://www.billerickson.net/yoast-schema-with-genesis/
 */
function be_disable_genesis_schema() {

	$elements = array(
		'head',
		'body',
		'site-header',
		'site-title',
		'site-description',
		'breadcrumb',
		'breadcrumb-link-wrap',
		'breadcrumb-link-wrap-meta',
		'breadcrumb-link',
		'breadcrumb-link-text-wrap',
		'search-form',
		'search-form-meta',
		'search-form-input',
		'nav-primary',
		'nav-secondary',
		'nav-header',
		'nav-link-wrap',
		'nav-link',
		'entry',
		'entry-image',
		'entry-image-widget',
		'entry-image-grid-loop',
		'entry-author',
		'entry-author-link',
		'entry-author-name',
		'entry-time',
		'entry-modified-time',
		'entry-title',
		'entry-content',
		'comment',
		'comment-author',
		'comment-author-link',
		'comment-time',
		'comment-time-link',
		'comment-content',
		'author-box',
		'sidebar-primary',
		'sidebar-secondary',
		'site-footer',
	);

	foreach( $elements as $element ) {
		add_filter( 'genesis_attr_' . $element, 'be_remove_schema_attributes', 20 );
	}
}

/**
 * Remove schema attributes
 *
 */
function be_remove_schema_attributes( $attr ) {
	$remove = array( 'itemprop', 'itemtype', 'itemscope' );
	foreach( $remove as $item ) {
		if( !empty( $attr[ $item ] ) )
			unset( $attr[ $item ] );
	}
	return $attr;
}
1 Like

Yoast team also recommends disabling genesis schema completely.

Hi

Yes, from the last release, v11, Yoast SEO already uses JSON-LD to add information about your site search, your site name, your logo and your social profiles to your web pages. You can find all the types of structured data that Yoast SEO premium can currently add to your site here : https://developer.yoast.com/schema-documentation/yoast-seo/.

As a double schema markups could get Google confused, we definitely suggest you deactivate the Genesis Schema markups already outputted by Yoast.

And bill erickson just released a plugin for genesis which does the same thing as gulshans code.

So highly recommended to remove genesis schema’s.

1 Like

Update on anyone using yoast and genesis - If u were using genesis breadcrumbs, ensure u replace them with yoast. As yoast has better breadcrumbs + schema markup for breadcrumbs.

if we use the plugin “disable genesis schema”, then it disables breadcrumbs schema as well. It means - users will be able to see your site structure but search engine wont see your site structure via breadcrumbs. So enable yoast breadcrumbs and disable genesis breadcrumbs if using yoast SEO 11 or above.

2 Likes

Any tutorial implement it in functions.php?

//* Add Yoast Breadcrumbs

add_action( 'loop_start', 'wordpress_seo_plugins_breadcrumbs' );
function wordpress_seo_plugins_breadcrumbs() {
if ( function_exists('yoast_breadcrumb') ) {
	yoast_breadcrumb('<p id="breadcrumbs">','</p>');
	}
}

Add this snippet via Code Snippets plugin.

1 Like

I have been using code in functions.php and it’s showing like this


Do I need to replace the old code with this one? or Can I make some minor changes with the above code in this code?

Previously I have been using the code from Crunchify

That is fine. But do u have yoast breadcrumb enabled in Yoast >> Search appearences >> Breadcrumbs.

And do u have genesis breadcrumbs disabled via Genesis >> Theme Settings >> Disable all breadcrumbs.

if ur answer to above both question is yes, then u are fine.