• Resolved snicholson

    (@snicholson)


    We use the free version of the Yoast SEO plugin and we have run into an issue where we need to remove the graph schema data from the API. Per the API documentation, we added this exact code to our functions.php

    //Removes the Yoast Graph Schema From The API
    add_filter( ‘wpseo_json_ld_output’, ‘__return_false’ );
    //End removal of graph schema from API

    When we run a request through Postman of:

    ourdomain.com/wp-json/wp/v2/posts/9580

    We receive a succusful 200 response and we see the data, *including* the Yoast schema data. We have cleared the server cache, restarted Postman, etc..but it still shows, so I’m wondering if that directive still works. Is there a way to actually remove it?

    Thanks for any help you can provide.

    –Sean

Viewing 2 replies - 1 through 2 (of 2 total)
  • @snicholson

    I understand you’re trying to remove the Yoast Graph Schema From The API using the given filter but did not work in your case.

    To confirm, we checked by adding the same filter on the default TwentyTwenty theme, and with Yoast SEO v16.7 and WordPress v5.8, the filter work as expected.

    Checking the page source of the website, we also did not find the schema information that outputs within script format <script type="application/ld+json" class="yoast-schema-graph">.

    Can you please check your configuration and verify from the page source too?

    You may need to clear the cache as well.

    We look forward to hearing from you.

    Plugin Support Michael Ti?a

    (@mikes41720)

    Hello,

    This thread has been marked as resolved due to a lack of activity.

    You’re always welcome to re-open this topic. Please read this post before opening a new request.

    Thanks for understanding!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Removing Graph Schema data From API JSON output’ is closed to new replies.