Remove Divi Shortcodes When Changing Themes – WPCrafter

THIS. TOTALLY. WORKED.

When I switched from using Divi Builder‘s drag-and-drop WordPress page builder to Beaver Builder‘s, ALL my pages ended up with Divi shortcode filling the page. UGLY. I started to manually delete the Divi shortcode from two pages then realized, damn, this is gonna take FOREVER!

Found a solution from WPCrafter that strips out all of the Divi shortcodes, just by adding a few lines of code to the Beaver Builder Child Theme’s functions.php file:

add_filter('the_content', 'remove_divi_shortcodes');
function remove_divi_shortcodes( $content ) {
$content = preg_replace('/\[\/?et_pb.*?\]/', '', $content);
return $content;
}

About Reid Walley

Dance music and Bruce Lee fan!

Leave a Comment