Title: Knowledge Graph markup causing Structured Data validation warning
Last modified: July 5, 2018

---

# Knowledge Graph markup causing Structured Data validation warning

 *  [silverks](https://wordpress.org/support/users/silverks/)
 * (@silverks)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/knowledge-graph-markup-causing-structured-data-validation-warning/)
 * The Knowledge Graph markup generated by the plugin is causing warnings when tested
   with Google Structured Data validation tool.
 * I would like to suggest the following fix. In `includes/json/knowledge-graph.
   php`, modify the code around line 81 from this:
 *     ```
       if ( $type == 'Organization' ) {
       	$logo = esc_attr( stripslashes( schema_wp_get_option( 'logo' ) ) );
       } else {
       	$logo = '';
       }
       ```
   
 * to this:
 *     ```
       if ( $type == 'Organization' ) {
       	$image_url = esc_attr( stripslashes( schema_wp_get_option( 'logo' ) ) );
   
       	if ( $image_url ) {
       		$logo = array(
           		"@type" 	=> "ImageObject",
           		"url" 		=> $image_url,
       		);
       	} else {
       		$logo = '';
       	}
       } else {
       	$logo = '';
       }
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Hesham Zebida](https://wordpress.org/support/users/hishaman/)
 * (@hishaman)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/knowledge-graph-markup-causing-structured-data-validation-warning/#post-10478813)
 * I am not sure what kind of warnings you are getting. But It seems to be working
   fine this way. Also Google suggest setting Logo with only a URL, that’s why it’s
   done this way in the plugin.
 * On my tests; I don’t see any warnings in the Organization markup (see example
   test for schema.press site [here](https://search.google.com/structured-data/testing-tool?url=https://schema.press/#url=https%3A%2F%2Fschema.press%2F)).
 * Also, have a look at [Logo guidelines](https://developers.google.com/search/docs/data-types/logo).
 * Does the code snippet you’ve suggested clear the warning?
 *  [solarblitz77](https://wordpress.org/support/users/solarblitz77/)
 * (@solarblitz77)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/knowledge-graph-markup-causing-structured-data-validation-warning/#post-10575573)
 * I’m getting a similar error on a clients website.
 * **[https://search.google.com/structured-data/testing-tool/u/0/?url=https://residentiallandlord.com/property-investment-wales-916/#url=https%3A%2F%2Fresidentiallandlord.com%2Fproperty-investment-wales-916%2F](https://search.google.com/structured-data/testing-tool/u/0/?url=https://residentiallandlord.com/property-investment-wales-916/#url=https%3A%2F%2Fresidentiallandlord.com%2Fproperty-investment-wales-916%2F)**
 * Its giving me the following error _”
    [https://residentiallandlord.com/wp-content/uploads/2018/07/Residentiallandlord-schema.jpg](https://residentiallandlord.com/wp-content/uploads/2018/07/Residentiallandlord-schema.jpg)(
   The attribute logo.itemtype has an invalid value.)”
 * If I copy that section of code and run it as a code snippet on its own, it shows
   no error. If I copy the html and amend the code from
 * `<script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"
   Organization","url":"https:\/\/residentiallandlord.com\/","sameAs":["https:\/\/
   www.facebook.com\/residentiallandlord","https:\/\/plus.google.com\/+ResidentiallandlordCoUk-
   2002","https:\/\/twitter.com\/help4landlords"],"@id":"https:\/\/residentiallandlord.
   com\/#organization","name":"Residential Landlord","logo":"https:\/\/residentiallandlord.
   com\/wp-content\/uploads\/2018\/07\/Residentiallandlord-schema.jpg"}</script>`
 * to
 * `<script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"
   Organization","url":"https:\/\/residentiallandlord.com\/","sameAs":["https:\/\/
   www.facebook.com\/residentiallandlord","https:\/\/plus.google.com\/+ResidentiallandlordCoUk-
   2002","https:\/\/twitter.com\/help4landlords"],"@id":"https:\/\/residentiallandlord.
   com\/#organization","name":"Residential Landlord","logo":{"@type":"ImageObject","
   url":"https:\/\/residentiallandlord.com\/wp-content\/uploads\/2018\/07\/Residentiallandlord-
   schema.jpg","width":600,"height":60}}</script>`
    It resolves the issue.
 * How do I amend this in the plugin, would the code suggested above do this? as
   I have over 2000 pages with the same warning
    -  This reply was modified 7 years, 9 months ago by [solarblitz77](https://wordpress.org/support/users/solarblitz77/).
    -  This reply was modified 7 years, 9 months ago by [solarblitz77](https://wordpress.org/support/users/solarblitz77/).
    -  This reply was modified 7 years, 9 months ago by [solarblitz77](https://wordpress.org/support/users/solarblitz77/).

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Knowledge Graph markup causing Structured Data validation warning’ is
closed to new replies.

 * ![](https://ps.w.org/schema/assets/icon-256x256.png?rev=1750173)
 * [Schema](https://wordpress.org/plugins/schema/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/schema/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/schema/)
 * [Active Topics](https://wordpress.org/support/plugin/schema/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/schema/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/schema/reviews/)

## Tags

 * [markup](https://wordpress.org/support/topic-tag/markup/)

 * 2 replies
 * 3 participants
 * Last reply from: [solarblitz77](https://wordpress.org/support/users/solarblitz77/)
 * Last activity: [7 years, 9 months ago](https://wordpress.org/support/topic/knowledge-graph-markup-causing-structured-data-validation-warning/#post-10575573)
 * Status: not resolved