# Full-Width Blog Posts in Divi

> Removes the sidebar from single blog posts in the Divi theme and gives the content the full width, without editing each post's layout setting.

- Type: PHP
- Runs: Run everywhere
- Category: [Page Builders & Themes](https://wpide.com/library/category/page-builders/)
- Tags: divi, sidebar, layout, posts
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/divi-posts-without-sidebar/

## Code

```php
// Post types that should always be full width.
$wpide_divi_full_width_types = array( 'post' );

add_filter( 'get_post_metadata', function ( $value, $object_id, $meta_key ) use ( $wpide_divi_full_width_types ) {
    if ( '_et_pb_page_layout' !== $meta_key || is_admin() ) {
        return $value;
    }

    if ( in_array( get_post_type( $object_id ), $wpide_divi_full_width_types, true ) ) {
        return array( 'et_full_width_page' );
    }

    return $value;
}, 10, 3 );
```

## Notes

Change post to another post type slug, or add more, in $wpide_divi_full_width_types.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Full-Width Blog Posts in Divi" 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/
