[Support request] AMP version giving Error 'Missing or invalid structured data item'

Home Forums Support [Support request] AMP version giving Error 'Missing or invalid structured data item'

Home Forums Support AMP version giving Error 'Missing or invalid structured data item'

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #934404
    Amit

    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/

    #934484
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Is there any more to the error? For example, which element is it referring to?

    #934502
    Amit

    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.’

    #934517
    Tom
    Lead Developer
    Lead Developer

    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' );

    #935570
    Amit

    Hey Tom, I don’t know technically about these things. Can you suggest what is better for site SEO and how to do it?

    #935748
    Amit

    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!

    #936052
    Tom
    Lead Developer
    Lead Developer

    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.

    #938290
    Amit

    I inserted your given function, but still, 1 error is left! What to do about that?

    #938686
    Tom
    Lead Developer
    Lead Developer

    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.

    #939085
    Amit

    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?

    #939090
    Amit

    I again changed it to person, and now errors are gone! Don’t know what exactly did this but now they are gone…

    #939725
    Tom
    Lead Developer
    Lead Developer

    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”.

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.