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 the founder of Lakewood media. Also an avid landscape and travel photographer.
You may also like
How to fix Webmaster Console crawl errors in WordPress
How to easily fix Google Webmaster Console Errors on your WordPress site using a simple, free plugin. Improve your WordPress site SEO.
0 Comments3 Minutes
How to Improve Your Online Presence
3 steps to improve your digital presence. Whether your business is based online or not, all companies need to have some online presence in the digital age.
0 Comments4 Minutes
How to Hunt for Affordable WordPress Consultancy Services and Actually Hire One
Learn how to find WordPress consultancy services on Google, LinkedIn, and startup directories like Beta List and Product Hunt.
0 Comments14 Minutes
How to create Legal Pages for your WordPress website
Learn how to create Legal Pages in WordPress, use manual approach, WordPress plugins, or hire a Lawyer to create Legal Pages for your WordPress site.
0 Comments13 Minutes
How to Design a Site Experience Users Will Love
It's no secret that a website is basically the face of the company. It is the representation of its story and mission, as well as the company's main point of sale, in most cases.
0 Comments12 Minutes
How to optimise and compress your images
A quick guide to optimising, compressing and resizing your images on your Mac or Windows computer before uploading to your website.
0 Comments8 Minutes