Remove Divi Shortcodes When Changing Themes – WPCrafter


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;

Similar Posts

One Comment

Leave a Reply

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