# Use Elementor Only on Pages

> Limits Elementor to the post types you choose (pages by default), so the "Edit with Elementor" button disappears from blog posts and other content types.

- Type: PHP
- Runs: Run everywhere
- Category: [Page Builders & Themes](https://wpide.com/library/category/page-builders/)
- Tags: elementor, post-types, editor
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/elementor-limit-post-types/

## Code

```php
// Post types that may be edited with Elementor.
$wpide_el_post_types = array( 'page' );

$wpide_el_cpt_support = function () use ( $wpide_el_post_types ) {
    return $wpide_el_post_types;
};

add_filter( 'option_elementor_cpt_support', $wpide_el_cpt_support );
add_filter( 'default_option_elementor_cpt_support', $wpide_el_cpt_support );
```

## Notes

Posts already built with Elementor keep their design; add post to the list if you still need to edit them.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Use Elementor Only on 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/
