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?

     Tareq updated 2 months, 1 week ago 2 Members · 3 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.

  • Tareq

    Member
    Jun 3, 2020 at 6:46 pm

    I was wondering would this still work today? I want to start using Gutenberg and the theme you recommended in one of your youtube videos but I am worried that it will look a mess and the left over shortcodes would continue to slow down my site.

    Note: I am not a developer just working on my blog to make it breath-taking 😎

    Thank you!

Log in to reply.

Original Post
0 of 0 posts June 2018
Now

Stay Up To Date

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