We have a WordPress page made with WPBakery Page Builder that has hundreds of text blocks that each include the phrase "Contact us". I need to change them all to "For help", but I might have to change them back again or to a different phrase at any time. It will be extremely tedious, not to mention mistake-prone, to click my way through hundreds of blocks just to update this phrase, particularly since I might have to do it all over again next week or in a month.

Is there any way to accomplish this kind of update by changing the phrase in a single spot with all the various blocks refering to this "global" string value? (Just to be clear, I'm using "global" to mean only for this particular page.) It won't help me this time, of course, but would be very helpful in the future.

1

There are 1 best solutions below

1
On

WP Bakery Pages strings are encoded as base64 strings.

I found php help here: [1]: Changing urls in visual composer's raw html block

What I did was place this script into a file called base64-search-replace.php and included this into my functions.php file which I can easily comment out when not required.

//require_once('base64-search-replace.php');//for fixing wp bakery pages after migration.

If you have any CPT (custom post types) as you may need to change this line of code

//post_type set to one of these: "products","tech","pages"
$response = $wpdb->get_results('SELECT ID,post_content FROM wp_posts WHERE post_type="tech"',ARRAY_A);

from "page" to the custom post type