# Body Class for Pages Built With Elementor

> Adds a "wpide-elementor-page" class to the body of pages built with Elementor, so your theme CSS can treat designed pages differently from regular posts.

- Type: PHP
- Runs: Frontend only
- Category: [Page Builders & Themes](https://wpide.com/library/category/page-builders/)
- Tags: elementor, css, body-class
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/elementor-body-class-on-builder-pages/

## Code

```php
add_filter( 'body_class', function ( $classes ) {
    if ( is_singular() && 'builder' === get_post_meta( get_queried_object_id(), '_elementor_edit_mode', true ) ) {
        $classes[] = 'wpide-elementor-page';
    }

    return $classes;
} );
```

## Notes

Use it in CSS, for example .wpide-elementor-page .site-content { padding: 0; }.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Body Class for Pages Built With Elementor" 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/
