WPCrafter Community

Find answers, ask questions, and connect with our
WordPress community around the world.

Home Community General Questions How do you remove Divi shortcodes when changing themes?

  • How do you remove Divi shortcodes when changing themes?

     Adam updated 2 years, 3 months ago 1 Member · 2 Posts
  • Adam

    Administrator
    Nov 16, 2017 at 4:11 pm

    Problem with Divi 3 is that all the content is essentially a mesh of shortcodes, so if you ever want to start using something other then Divi Builder, all your content is a huge mess.

    How do you remove Divi Builder shortcodes?

  • Adam

    Administrator
    Nov 16, 2017 at 4:13 pm

    As you've mentioned, changing themes you've used a page builder with is always going to leave you having to re-design/re-build pages/posts etc.

    However, after running into too many conflicts with Divi I had to try this last resort of switching themes… and it's a much nicer process without the shortcode filling your page.

    This worked for me without having to use All Export/Import:

    I recreated the site locally, installed the new theme (BB & BB Child), activated the child theme and added the following to functions.php

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

    Hopefully, this might work for someone else.

Log in to reply.

Original Post
0 of 0 posts June 2018
Now

Stay Up To Date

Enter your name and email for the lates news, updates, and tutorials.