Take your website
To the next level
Discover our newly launched customization services and elevate your web projects to new heights.
Delegate tasks, save time, and unlock the power of professional WordPress outsourcing.

Okay
  Public Ticket #3728102
wp bakery shortcodes
Closed

Comments

  • franc started the conversation

    I am building all my pages on elementor instead of wp bakery (previous used on the website). 

    Before launching the new site, should I use a plugin top suppress the old wp bakery shortcodes ? 

  •  7,120
    Oliver replied

    Hi, 

    sorry, I am not quite sure what exactly you mean by " should I use a plugin top suppress the old wp bakery shortcodes" - can you please provide more details?

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver

  • franc replied

    I ant to suppress all the shortcodes generated by WP Bakery that I do not use any more and that could pollute my website.... 

  •  7,120
    Oliver replied

    OK, I see, thank you. Yes, there are a few plugins and approaches that can help remove leftover WPBakery shortcodes after moving a website to Elementor.  Here are some solutions:

    https://wordpress.org/plugins/better-search-replace/

     While not specific to shortcodes, Better Search Replace is a robust plugin for searching and replacing content in the WordPress database.You can use this tool to search for specific WPBakery shortcodes like [vc_row], [vc_column], etc., and replace them with blank space. This effectively removes the shortcodes sitewide.


    If you are comfortable with custom code, you can add a PHP snippet to your theme’s functions.php file to remove WPBakery shortcodes. Here's an example:

    function remove_wpbakery_shortcodes( $content ) {
        $shortcodes = array( 'vc_row', 'vc_column', 'vc_column_text', 'vc_section' ); // Add other shortcodes as needed
        foreach ( $shortcodes as $shortcode ) {
            $content = preg_replace( '/\[' . $shortcode . '[^\]]*\](.*?\[\/' . $shortcode . '\])?/', '', $content );
        }
        return $content;
    }
    add_filter( 'the_content', 'remove_wpbakery_shortcodes' );

    IMPORTANT NOTE: You need to backup your website and your database prior to using this approaches in order to be able to roll back in case something will go wrong. 

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver