• Resolved Ana A

    (@ihealthcareanalyst)


    Hi,

    How to disable the default #primaryimage schema, or change its url to specific image(s), since google structure data testing tool throws an error – image size smaller than the recommended, for amp posts.

    WebPage
    
    @type: WebPage
    @id: <canonical>#webpage
    url: <canonical>
    inLanguage: <site language>
    name: <page title>
    description: <page description>
    isPartOf - references WebSite @id: <homepage_url>/#website
    image - when we have a featured image.
    @type: ImageObject
    <strong>@id: <canonical>#primaryimage
    url: <image_url></strong>
    caption: <image caption>

    Any filter or hook from Yoast API docs would be appreciated.

    Thank you.
    Ana

    • This topic was modified 5 years, 5 months ago by Ana A.
    • This topic was modified 5 years, 5 months ago by Ana A.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi,

    You will need to edit the schema using our code snippets here https://developer.yoast.com/schema-documentation/api/.

    Unfortunately, there’s a difference between the support we can offer and the level of programming needed to change (core) features of our plugin. Since we don’t want to take the risk that we break your website by suggesting incorrect or incomplete code, we cannot advise you on how to make such changes. And even though we cannot be of any assistance, you’re completely free to change anything in the plugin to better suit your needs.

    If needed, we highly recommend checking out the Yoast supported partners here:?https://yoast.com/yoast-partners/.?

    We will also keep this topic open for 1 week in case a member from the community is able to help. After that we will close it in order to keep the overview.

    Thread Starter Ana A

    (@ihealthcareanalyst)

    Hi @pcosta88,

    Thank you for your reply.

    The same above point is reiterated with some code and more clarity in this post:
    Change to default featured image (article schema #primaryimage)

    Would you be able to help with fixing/adjusting the code please?
    Thanks in advance.

    Hi,

    Unfortunately, we do not want to put you or us in a situation where we suggest a specific line of code and it adversely affects your site. We can only say you need to use the guidance in the schema documentation link to disable the primary schema image.

    If you are not sure how to do that, you may need to refer to a Yoast partner.

    We will keep this topic open for a couple more days in case someone from the Yoast community is able to further assist. After which we will close this topic to keep the overview.

    Plugin Support devnihil

    (@devnihil)

    We are going ahead and marking this issue as resolved due to inactivity. If you require any further assistance please create a new issue.

    Hi Guys,

    I know you said you cannot advise on the code in here but I’m trying the hook you mentioned in your API documentation to remove primary image and it doesn’t do anything:

    add_filter( ‘wpseo_schema_needs_primaryimage’, ‘__return_false’ );

    if i try the same approach for other graph pieces like webpage or website it works fine and removes the schema element e.g. add_filter( ‘wpseo_schema_needs_website’, ‘__return_false’ );

    what am i doing wrong for the primaryimage part?

    thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to disable or change #primaryimage schema’ is closed to new replies.