Home / Admin / Add the type property to that Image property in the Organization schema
Duplicate Snippet

Embed Snippet on Your Site

Add the type property to that Image property in the Organization schema

This snippet will add the 'ImageObject' type property in the 'Organization' schema markup.

200+
Code Preview
php
<?php
add_filter( 'aioseo_schema_output', 'add_author_name_when_missing' );
function add_author_name_when_missing( $schema ) {	
		foreach ( $schema as &$schemaItem ) {
			if ( isset($schemaItem['@type']) && 'Organization' === $schemaItem['@type'] ) {
				if(!isset($schemaItem['image']['@type'])){
					$schemaItem['image']['@type'] = 'ImageObject';
				}
			}
		}
	return $schema;
}

Comments

Add a Comment