# Turn Off Yoast Schema on Selected Pages

> Removes the Yoast SEO JSON-LD graph from the pages you list, for example landing pages where you print your own structured data.

- Type: PHP
- Runs: Frontend only
- Category: [Plugin Integrations](https://wpide.com/library/category/integrations/)
- Tags: yoast, schema, json-ld
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/yoast-disable-schema-selected-pages/

## Code

```php
// IDs of the posts or pages that should not get Yoast's schema.
$wpide_no_schema_ids = array( 12, 34 );

add_filter( 'wpseo_json_ld_output', function ( $output ) use ( $wpide_no_schema_ids ) {
    if ( is_singular() && in_array( get_queried_object_id(), array_map( 'intval', $wpide_no_schema_ids ), true ) ) {
        return false;
    }

    return $output;
} );
```

## Notes

List page or post IDs in $wpide_no_schema_ids. Yoast's other meta tags still print.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Turn Off Yoast Schema on Selected Pages" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
