• Resolved comodern

    (@comodern)


    We use the Yoast plugin for wordpress. We’d like to replace the auto-generated schema structured data on our top 20 pages with our own custom tailored structured data. How can we completely replace the schema structured data that Yoast generates on an individual post?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Maybellyne

    (@maybellyne)

    Hello @comodern

    Thanks for reaching out. If you return false or an empty array on the wpseo_json_ld_output filter, you disable all Yoast SEO’s schema output.

    add_filter( 'wpseo_json_ld_output', '__return_false' );
    Thread Starter comodern

    (@comodern)

    Thanks. Where on the post do I insert this line?

    Plugin Support Maybellyne

    (@maybellyne)

    Typically, code snippets are added to your theme’s functions.php file. If you’re unfamiliar with using code snippets, we’d like to refer you to the WordPress documentation on how to use a filter.

    Thread Starter comodern

    (@comodern)

    We only want to replace the structured data on specific posts, not all posts. Is that possible?

    Hi @comodern

    You have to add proper customization to replace the structured data on specific posts. As mentioned before, you can use the filter ‘wpseo_json_ld_output’ and write a function as required.

    We recommend creating regular backups of your site and database for your site’s health and safety. A backup is crucial before making important changes on your website and provides you with a safety net if something were to go wrong. Learn more about the benefits of regular backups.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Replacing Schema structured data’ is closed to new replies.