The Divi Builder plugin is a fantastic tool for adding endless layouts to your pages and posts, we use the Divi Builder plugin on this site as it provides a quick and easy way to build rich, beautiful layouts. The downside to Divi Builder is that it comes with a heavy page load on all pages of your site by default even if the page/post isn’t using the builder.
We only use the Divi Builder on certain posts and pages so had no need for the scripts and styles to be enqueued on all pages. We wrote this quick function to dequeue the divi builder scripts unless the page builder is active on the current page/post.
Divi Page Builder Dequeue scripts unless the page builder is active on current page:
function deregister_script() { $is_page_builder_used = et_pb_is_pagebuilder_used( get_the_ID() ); if( !$is_page_builder_used ) { wp_dequeue_script('et-builder-modules-global-functions-script'); wp_dequeue_script('google-maps-api'); wp_dequeue_script('divi-fitvids'); wp_dequeue_script('waypoints'); wp_dequeue_script('magnific-popup'); wp_dequeue_script('hashchange'); wp_dequeue_script('salvattore'); wp_dequeue_script('easypiechart'); wp_dequeue_script('et-jquery-visible-viewport'); wp_dequeue_script('magnific-popup'); wp_dequeue_script('et-jquery-touch-mobile'); wp_dequeue_script('et-builder-modules-script'); } } } add_action( 'wp_print_scripts', 'deregister_script', 100 );
Divi Page Builder Dequeue styles unless the page builder is active on current page:
function deregister_styles() { $is_page_builder_used = et_pb_is_pagebuilder_used( get_the_ID() ); if( !$is_page_builder_used ) { wp_dequeue_style('et-builder-modules-style'); } } add_action( 'wp_print_styles', 'deregister_styles', 100 );
You can place the functions in your theme functions.php file or create a MU plugin for them.
Please note this is for the Divi Builder plugin and not the Divi Theme

Adam
Editor of the Lakewood Journal and founder of Lakewood media. Also an avid landscape and travel photographer.
You may also like
How to Attract the Right Audience with SEO Content
In this guide, we share tips on finding content ideas and how to make the most of your online presence so that the right people can find you organically.
0 Comments16 Minutes
The easy way to find SEO Competitors with Free Tools
While doing competitor analysis for keyword research, you will need to find relevant competitors, learn how to find SEO competitors with free SEO tools.
0 Comments9 Minutes
How to create a Link between Google Analytics and Search Console
Learn how to integrate Google Analytics with Search Console and obtain search data right in the Analytics' dashboard of your site.
0 Comments9 Minutes
How to do Keyword Research with free SEO tools
Learn how to perform keyword research with free SEO tools, learn how to obtain data with free tools, chrome extensions, and Google auto-complete feature.
0 Comments13 Minutes