# Turn Off Rank Math Schema on Selected Pages

> Removes all Rank Math JSON-LD from the posts or pages you list, so you can add hand-written structured data there instead.

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

## Code

```php
// IDs of posts or pages without Rank Math schema.
$wpide_rm_no_schema = array( 12, 34 );

add_filter( 'rank_math/json_ld', function ( $data ) use ( $wpide_rm_no_schema ) {
    if ( is_singular() && in_array( get_queried_object_id(), array_map( 'intval', $wpide_rm_no_schema ), true ) ) {
        return array();
    }

    return $data;
}, 999 );
```

## Notes

List post or page IDs. Meta tags from Rank Math still print.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Turn Off Rank Math 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/
