Archived topic
AMP version giving Error 'Missing or invalid structured data item'
11 replies · Started by Amit on June 19, 2019
I really don't know as this is about Generatepress or not, but I would really appreciate if you can have a glance on this as I am unable to find a solution to this.
The following are the 2 pages I am getting error on to-
- https://www.friedcoffee.com/best-nespresso-machine/
- https://www.friedcoffee.com/nespresso=pods/
Hi there,
Is there any more to the error? For example, which element is it referring to?
No proper error, when I checked in structured data testing tool, the following were the errors-
'The attribute publisher.itemtype has an invalid value.'
'A value for the name field is required.'
Ah, that's because you're using Yoast JSON+LD to set the post as an "Article".
If you run your page through this tool, you'll see the "Article" type requires additional information on the page: https://search.google.com/structured-data/testing-tool
You'll also want to remove the GP schema if you're using JSON+LD from Yoast:
add_filter( 'generate_schema_type', '__return_false' );
Hey Tom, I don't know technically about these things. Can you suggest what is better for site SEO and how to do it?
I even checked the normal post page in the structured data testing tool and it's giving 12 errors and 4 warnings. It's getting me worried now!
Did you try adding the filter I provided? There's no need for the GP schema if you're using JSON+LD from Yoast.
Alternatively, you can turn off the Yoast option and keep the GP schema.
I inserted your given function, but still, 1 error is left! What to do about that?
That's an issue with the JSON+LD you're using. You've set the content type to Article, so the author attribute needs a "name". It should be a setting in the plugin you're using to output JSON+LD.
There is no setting to change the article type in the Yoast plugin. Also, if it's not the type 'article', what it should be?
I again changed it to person, and now errors are gone! Don't know what exactly did this but now they are gone...
It might be worth checking with Yoast support to see how you can define the author name. That way you could keep it as an "Article".