# Hide Rank Math on Selected Post Types

> Removes the Rank Math meta box and settings from post types that are never shown in search, such as internal records or form entries.

- Type: PHP
- Runs: Run everywhere
- Category: [Plugin Integrations](https://wpide.com/library/category/integrations/)
- Tags: rank-math, admin, custom-post-types
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/rankmath-exclude-post-types/

## Code

```php
// Post types Rank Math should ignore.
$wpide_rm_hidden_types = array( 'testimonial', 'faq' );

add_filter( 'rank_math/excluded_post_types', function ( $post_types ) use ( $wpide_rm_hidden_types ) {
    return array_diff_key( (array) $post_types, array_flip( $wpide_rm_hidden_types ) );
} );
```

## Notes

Use post type names; the type disappears from Rank Math's Titles & Meta settings too.

## How to use it

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