Publisher itemtype wrong value
-
Hi,
the schema valudating tool shows:
Attribut publisher.itemtype – invalid value.
I set the publisher logo, the featured image and chose organization.
On several pages also it shows that the headline is too long – is there a way to limit the characters number on output automatical?
Site is:
https://berufebilder.deThanks for your help!
The page I need help with: [log in to see the link]
-
Hi,
A couple of points:
1) The error you are seeing is in “Article” markup, and it’s pointing to this meta in your website’ home page:
<meta itemprop="publisher" content="https://berufebilder.de" />So, since Schema plugin output markup in JSON-LD format, this meta mentioned above is not part of the output. (it’s caused by something else, maybe the Theme you are using or another plugin).
I suggest that you try to find a way to remove it. You mostly don’t need that.
2) The headline length should be something between 0-110 characters, add this function to your Theme’s functions.php to automatically trim the headline output:
add_filter('schema_output', 'schema_wp_shorten_headline_output_98734524456'); /** * Shorten / Limit Headline in Schema Output * * String length of headline must be in range [0, 110] * * @since 1.0 */ function schema_wp_shorten_headline_output_98734524456( $schema ) { global $post; if ( empty($schema) ) return; $more = '…'; // indicate that it was shortened // shorten to a number of words // $num_words = 12; // change to your liking // $schema['headline'] = wp_trim_words( $schema['headline'], $num_words, $more ); // shorten to a number of characters // $num_characters = 110; // change to your liking // $schema['headline'] = substr( $schema['headline'], 0, $num_characters ); // or... $num_characters = 109; // change to your liking, recommended is 109 $schema['headline'] = rtrim( mb_strimwidth( $schema['headline'], 0, $num_characters ) ) . $more; return $schema; }Here is a link to the code gist.
Note: If you don’t want the
…at the end of the headline, change$more = '…';to$more = '';, and you can change the $num_characters value to 110 since we removed the….P.S. After adding the function to your Theme’s functions.php file, open the Schema plugin settings page and just save settings once, this will flush the post meta cached data and store the new shortened headline.
I hope this helps.
Hi Thank you very much, everything is just fine now.
There is just one Probelem with the Comment-Images on some pages – do you have any ideas about that?
Just to understand: If I in my theme find parts of a meta-schema I can remove that because you add your own?
Thank you again.
Glad to hear that you got this sorted.
For the image, this actually the blog post image (it doesn’t belong to comments, comments markup is fine).
Google Structured Data Testing Tool started recently to show an error for each blog post that has no image that presents its content.
The only legit way to solve this it to upload a unique Featured image for each article or blog post. However you can do a quick fix by installing the free Schema default image plugin extension to do so.
For your last question, the answer is mostly a “Yes!”, you can safely remove other markups generated by the Theme you are using, and let Schema does it for you.
Hi,
thank you for your great help, I downloaded the Schema default image, installed it, hit the button – and nothing happened. There is no field I can select an image to upload.
Hope that dosn’t get to complicated…The default image cab be set by going to Schema > Types > and edit the specific type you would like to set a default image for.
Here is a screenshot from the plugin page:

This default image will be used across the whole post type, so if the Schema plugin can’t find a Featured image, it will use the default.
Just want to make sure you understand that I made this extension to solve the errors based on plugin users requests. But, still uploading a unique Featured image for each article or blog post is the ideal and right thing to do.
I am putting together a new page in the documentation section with more details on using the default image extension.
Thank you, thats exactly what I see.
Then I click to that button to upload a picture – and nothing happens.
No error message or something, just nothing.Thanks for the help.
Ok, I see!
I’ve just tested everything and it works on my test site. Also, there is no errors.
So, I think there must be an error somewhere at your end, it could be a conflict with another plugin. (if you are using a development staging) maybe you can disable plugins, then enable them one by one till you find the one that conflicts.
Something you can do quickly, if you can inspect the page in chrome then click on the upload image button, maybe you will find errors in console, this will be great help.
Thank you. In Chrome I could add the image.
While disabling Plugins didn’t help in Firefox.Now no errors anymore.
Thank you again for your help!
-
This reply was modified 8 years, 7 months ago by
berufebilder.
Thanks for the details, I will keep an eye on this and see if I can fix it in future updates.
-
This reply was modified 8 years, 7 months ago by
The topic ‘Publisher itemtype wrong value’ is closed to new replies.