Can't change Schema.org (JSON) Metadata Publisher Logo
-
I can’t for the life of me figure out why I can’t change the “publisher logo” output in our schema.org metadata.
For instance, this is the logo that is showing up in AMP search results: https://i2.wp.com/gossiponthis.com/wp-content/uploads/2016/02/apple-touch-icon.png
This is the logo that I would like to show: https://i2.wp.com/gossiponthis.com/wp-content/themes/Newspaper-child/images/got-amp-logo.png
According to the documentation, I should be able to change the logo by doing what is outlined here: https://github.com/Automattic/amp-wp/blob/master/readme.md#schemaorg-json-metadata
I have done that, and this is what my AMP schema.org metadata is outputting:
<script type="application/ld+json">{"@context":"http:\/\/schema.org","@type":"NewsArticle","mainEntityOfPage":"http:\/\/gossiponthis.com\/2016\/03\/08\/skully-aka-no-plug-guy-who-killed-bankroll-fresh\/","publisher":{"@type":"Organization","name":"Gossip On This","logo":{"@type":"ImageObject","url":"http:\/\/i2.wp.com\/gossiponthis.com\/wp-content\/uploads\/2016\/02\/apple-touch-icon.png?fit=60%2C60","width":60,"height":60}},"headline":"Skully (aka No Plug): Is This the Guy Who Killed Bankroll Fresh?","datePublished":"2016-03-08T17:50:14+00:00","dateModified":"2016-03-09T01:26:43+00:00","author":{"@type":"Person","name":"BaRock Odrama"},"image":{"@type":"ImageObject","url":"http:\/\/i0.wp.com\/gossiponthis.com\/wp-content\/uploads\/2016\/03\/skully-no-plug-bankroll-fresh.jpg?fit=800%2C450","width":800,"height":450},"description":"The streets and the Internet are both talking, and they're saying that they know who murdered Bankroll Fresh."}</script>
Notice how the “type” has been changed to “NewsArticle,” however my logo remains unchanged.
This is what I have in “functions.php”
/** * Modify schema.org metadata. */ add_filter( 'amp_post_template_metadata', 'got_amp_modify_json_metadata', 10, 2 ); function got_amp_modify_json_metadata( $metadata, $post ) { $metadata['@type'] = 'NewsArticle'; $metadata['publisher']['logo'] = array( '@type' => 'ImageObject', 'url' => get_template_directory_uri() . '/images/got-amp-logo.png', 'height' => 60, 'width' => 600, ); return $metadata; }
Am I doing something wrong?
- The topic ‘Can't change Schema.org (JSON) Metadata Publisher Logo’ is closed to new replies.