Enable Divi Builder by Default on New Posts / Pages

This post may contain referral links which may earn a commission for this site

The Divi Theme gives you the option of using the Divi Builder drag and drop editor on your posts and pages. This is normally something you have to explicitly enable by clicking on the "Use Divi Builder" button on every single post / page you start. Wouldn't it be great if you could have the Divi Builder automatically enabled on your new posts and pages? Here's how to do it.

Enabling the Divi Builder using PHP

If you're comfortable adding PHP code to Divi, you can use the following code to set the Divi Builder as the default editor on new posts:
add_action('load-post-new.php', 'dbc_load_post_new_php'); 

function dbc_load_post_new_php() { 
	add_filter('et_builder_always_enabled', '__return_true');
}; 

Enabling the Divi Builder using Divi Booster

An option to make Divi Builder the default editor will be available in Divi Booster from version 2.5.9 onwards. You'll find it on the Divi Booster settings page, at:

"Divi Builder > Standard Builder > Enable Divi Builder by default on new pages / posts"

Simply check the box to enable the option, and then save your changes. The Divi Builder should now automatically be enabled on new posts and pages.

Want get more out of Divi?

Hundreds of new features for Divi
in one easy-to-use plugin

2 Comments

  1. What is the PHP code for determining which pages/posts currently use the Divi Builder?

    What is the PHP code for un-doing et_builder_always_enabled, to set "Always Use Gutenberg Editor" for new pages/posts?

    Reply
    • Hey George,

      1) you should be able retrieve the posts / pages currently using the Divi Builder with the following:

      $builder_posts = get_posts( array(
        'meta_key'   => '_et_pb_use_builder',
        'meta_value' => 'on',
      ));
      

      This will return an array of WP_Post objects of those pages / posts using Divi Builder.

      2) You can override the et_builder_always_enabled setting with this:

      add_filter('et_builder_always_enabled', '__return_false', 9999);

      You need to make sure the "priority" is set such that it comes after any other filter which is setting it to true. Here I've set the priority to 9999 which will probably be plenty in most cases (a larger number = value is set later).

      I haven't played around with it enough to know if that's enough by itself to achieve the desired "Always Use Gutenberg Editor" setting. If not, let me know and I'll dig into it some more. Thanks!

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Hundreds of new features for Divi
in one easy-to-use plugin

2 Comments

  1. What is the PHP code for determining which pages/posts currently use the Divi Builder?

    What is the PHP code for un-doing et_builder_always_enabled, to set "Always Use Gutenberg Editor" for new pages/posts?

    Reply
    • Hey George,

      1) you should be able retrieve the posts / pages currently using the Divi Builder with the following:

      $builder_posts = get_posts( array(
        'meta_key'   => '_et_pb_use_builder',
        'meta_value' => 'on',
      ));
      

      This will return an array of WP_Post objects of those pages / posts using Divi Builder.

      2) You can override the et_builder_always_enabled setting with this:

      add_filter('et_builder_always_enabled', '__return_false', 9999);

      You need to make sure the "priority" is set such that it comes after any other filter which is setting it to true. Here I've set the priority to 9999 which will probably be plenty in most cases (a larger number = value is set later).

      I haven't played around with it enough to know if that's enough by itself to achieve the desired "Always Use Gutenberg Editor" setting. If not, let me know and I'll dig into it some more. Thanks!

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *