Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing and required - publisher logo + name missing #349

Closed
TR-DK opened this issue Mar 24, 2016 · 19 comments

Comments

@TR-DK
Copy link

commented Mar 24, 2016

After the latest update (0.3.2) 99% off all post is now reporting error in Google Console.

Using Structured Data Testing Tool:

http://www.torbenrick.eu/blog/culture/why-is-organizational-culture-change-difficult/amp/

publisher [Organization]:
logo:
missing and required
name:
missing and required

How to fix that?

AMP version - 0.3.2
Glue for Yoast SEO & AMP - 0.3.2

@jery61007

This comment has been minimized.

Copy link

commented Mar 24, 2016

Hey just add this to your functions.php

add_filter( 'amp_post_template_metadata', 'amp_modify_json_metadata', 10, 2 ); // Adding custom metadata
function amp_modify_json_metadata( $metadata, $post ) {

   if( 'post'=== $post->post_type  ){

    $metadata['@type'] = 'Article';

   $metadata['publisher']['name'] = ' TORBEN RICK ';

    $metadata['publisher']['logo'] = array(
        '@type' => 'ImageObject',
        'url' => get_stylesheet_directory_uri().'/YOUR FOLDER NAME/YOUR LOGO NAME.png',
        'height' => 60,
        'width' => 250,
    );

   return $metadata; 

  } 
}
@TR-DK

This comment has been minimized.

Copy link
Author

commented Mar 24, 2016

Thanks - But where to add that in the functions.php?

Does this solve the problem with

publisher [Organization]:
name:
missing and required

?

@jery61007

This comment has been minimized.

Copy link

commented Mar 24, 2016

anywhere after <?php in the functions.php file of your theme and yea it should fix the problem and make sure the height of the image is 60 pixels and width below 600 pixels

@TR-DK

This comment has been minimized.

Copy link
Author

commented Mar 24, 2016

Done that - but a test (Structured Data Testing Tool )

http://www.torbenrick.eu/blog/strategy/the-importance-of-organizational-alignment/amp/

name:
missing and required

Where to add "name" in the code? Or?

Thanks

@jery61007

This comment has been minimized.

Copy link

commented Mar 24, 2016

I have updated the code, just copy and paste it .. it is supposed to add the name of your blog automatically but idk what is going on.... you might not have added that on your wordpress general settings area....

And if you want to customize your AMP page with your title and more, just follow these articles WordPress amp , AMP Related Posts

@TR-DK

This comment has been minimized.

Copy link
Author

commented Mar 24, 2016

WOW - BIG THANKS :-)

@KonstantinSchubert

This comment has been minimized.

Copy link

commented Apr 29, 2016

Won't this be overwritten by the next wordpress update?

@sadanandkasukurthi

This comment has been minimized.

Copy link

commented May 30, 2016

Super thanks to jery61007, from the last 4 days I am suffering by the issue publisher name & logo for my amp page http://www.digitalmediarole.com/monitor-major-google-analytics-reports/amp/. I have updated the above code in functions.php, now structured data tool is showing 0 errors. Thanks a lot!

@mjangda mjangda closed this Jun 22, 2016

@Codeeboy

This comment has been minimized.

Copy link

commented Aug 3, 2016

@jery61007 Hi jerry i put the above code in functions.php in theme file but still the error showing "A value for the logo field is required.", what can i do , can you help me plz.. my website is http://akshyaa.com/
thanks in advance

@waqarfakecrow

This comment has been minimized.

Copy link

commented Aug 30, 2016

Thanks that works cheers

@dianne92

This comment has been minimized.

Copy link

commented Sep 19, 2016

The height of the logo image should be exactly 60px or maximum. The thing is I added that code into the functions.php and I'm still getting the same error. Also, as KonstantinSchubert pointed out, won't this be overwritten the next wp/theme update ?

Can anyone take a look @ my website and tell me what I am doing wrong and why I keep getting this error if I followed those steps correctly? https://www.hlbenefits.com/health-benefits-pulses-superfood-future/amp/

@jery61007

This comment has been minimized.

Copy link

commented Dec 21, 2016

Hey guys whenever you edit your template or functions.php file, you should only do it in child theme otherwise everything will be wiped off in the next theme update. For a step by step customization, follow the link I shared in my previous comment then you have nothing to fear.. everything will work like a charm if you follow the tutorial ..... Yea you need to use earlier version of AMP plugin until you finish the customization based on the tutorial..... then you can update the plugin..

Thanks!

@Stormdiscount

This comment has been minimized.

Copy link

commented Jun 22, 2017

Good day,

Concernig Structured Data:
I have an issue that the Publisher Logo has no value set when tested with the google structured data test.

I wrote an detailed problem discription including images on https://community.mythemeshop.com/topic/78256-point-google-structured-data-publisher-logo-error/
Press read for full problem discription.

But i did not receive a reply there. On every url i get the LOGO error. Both for regular and AMP pages

http://www.mijngps.com/2017/06/21/geofence-gps-tracker-horloge-sos/
http://www.mijngps.com/2017/06/21/geofence-gps-tracker-horloge-sos/amp/

Running Wordpress 4.8
SCHEMA: 1.6.5
AMP: 0.9.53

So any detailed sugestion on how to set the value for Publisher logo is much appriciated.

@MohammedKaludi

This comment has been minimized.

Copy link

commented Jun 22, 2017

Hey @Stormdiscount

I have just checked your site (http://www.mijngps.com/2017/06/21/geofence-gps-tracker-horloge-sos/amp/) and found out that you are using AMPforWP plugin.

In AMPforWP plugin there is a separate settings panel for Structured Data. http://take.ms/dZDsL
There is also a logo uploader option, from where you can add a logo for Structured Data.

I'm sure after setting up the proper SD details will fix all your SD issues in AMP.

Thank You,
Mohammed Kaludi
Lead Dev and Co-Founder AMPforWP

@Stormdiscount

This comment has been minimized.

Copy link

commented Jun 22, 2017

Good Day Mohammed,

First off, thank you very much for your reply. Indeed you were correct that i had not set the Logo for AMP.

But now that i have set the Publisher logo for AMP, the value is still empty when checked with google. Just as with non amp structured data (where i already did set the Logo). Please see the image.

amp-structured-data

P.s.
I cleared all cache after editing to make sure.

Your help is much appriciated

Thank you.

@Stormdiscount

This comment has been minimized.

Copy link

commented Jun 24, 2017

Mohammed, i did find the solution. Please read the orginal topic for the solution.

https://community.mythemeshop.com/topic/78256-point-google-structured-data-publisher-logo-error/

Thanks again for your help.

@MohammedKaludi

This comment has been minimized.

Copy link

commented Jun 27, 2017

Hey @Stormdiscount

I'm glad that you found the solution.

Thank you for using our plugin,
Mohammed Kaludi

@Nik273

This comment has been minimized.

Copy link

commented May 26, 2018

After pasting your code most of the errors and warning was resolved. Big thanks for that. But after that I received this:

#JSON-LD Missing '}' or object member name on * (Problem Shows Here) add_filter.

This was my complete code:

<!-- JSON-LD markup generated by Google Structured Data Markup Helper. -->
<script type="application/ld+json">
{
  "@context" : "http://schema.org",
  "@type" : "Article",
  "name" : "6 Authentic Secret Life Rules You Should Stop Ignoring Right Now",
  "author" : {
    "@type" : "Person",
    "name" : "Nik"
  },
  "datePublished" : "2018-05-26",
  "image" : "https://2.bp.blogspot.com/-U6C1dlmerH0/WwlAOc9-QeI/AAAAAAAAK8s/4DHQaCDMoUcOF_8uQSpqSFvbOiBwbs1lwCLcBGAs/s640/MILLENIALTHING.jpg",
  "articleBody" : "Do you want to run away from your past? </SPAN><BR/>\n<SPAN style=\"font-family: inherit;\"><SPAN style=\"font-family: inherit;\">What others think about you is your prior concern?</SPAN></SPAN><BR/>\n<SPAN style=\"font-family: inherit;\"><SPAN style=\"font-family: inherit;\">How your friends are getting success in spite of putting the same effort?",
  "url" : "https://successrecepies.blogspot.in/",
  "publisher" : {
    "@type" : "Organization",
    "name" : "Success Recepies"
  },
 *(Problem Shows Here) add_filter( 'amp_post_template_metadata', 'amp_modify_json_metadata', 10, 2 ); // Adding custom metadata
function amp_modify_json_metadata( $metadata, $post ) {
   if( 'post'=== $post->post_type  ){
    $metadata['@type'] = 'Article';
   $metadata['publisher']['name'] = ' TORBEN RICK ';
    $metadata['publisher']['logo'] = array(
        '@type' => 'ImageObject',
        'url' => get_stylesheet_directory_uri().'/YOUR FOLDER NAME/YOUR LOGO NAME.png',
        'height' => 60,
        'width' => 250
    ),
   return $metadata; 
  } 
}
}
</script>

Kindly reply asap. Trying since long time :(

@Hoodlum-Z

This comment has been minimized.

Copy link

commented Mar 4, 2019

Is your problem the ) instead of } on the fifth line from the bottom?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.