Support » Plugin: Yoast SEO » How to remove the JSON-LD schema markup on custom post type only

  • Resolved becaneweb

    (@becaneweb)


    Hello,

    I have a display problem with custom post type “Newsletter”, the JSON-LD script display on my template as a paragraph.
    How to remove the JSON-LD schema markup just on custom post type ?

    Thanks !!

    • This topic was modified 2 years, 2 months ago by becaneweb.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    In order to disable Yoast SEO generated JSON+LD only on custom post types, you’ll need to implement custom code on your end using the following filter.

    wpseo_json_ld_output

    Unfortunately, we’re unable to provide the exact custom code that you’d need to implement on your site as this depends on your custom post types.

    Plugin Support jerparx

    (@jerparx)

    Closed due to inactivity.

    Thank you for your help,

    Currently I remove the JSON-LD schema markup on all the site with the following code.

    function bybe_remove_yoast_json($data){
        $data = array();
        return $data;
    }
    add_filter('wpseo_json_ld_output', 'bybe_remove_yoast_json', 10, 1);

    I would just remove it from the custom post type “newsletter” (it’s the name of my custom post type). If you can provide the exact custom code it would be great !

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to remove the JSON-LD schema markup on custom post type only’ is closed to new replies.