• Resolved nicole2292

    (@nicole2292)


    Hello, I need to replace some html content on 200+ pages of a site and all these pages are built with Beaver Builder.

    I am familiar and experienced with using Better Search and Replace and also https://interconnectit.com/search-and-replace-for-wordpress-databases/ for such as task.

    I understand that the Beaver Builder content is stored in the postmeta table and is serialized.

    The issue is that when I copy the content I need to find and replace directly from the database using php my admin and paste it directly into either of these tools the content is not found.

    I have discovered through testing that this is due to white space and new lines in the html. If I search on content which is all shown on a single line in php my admin and does not have any white space then it is found.

    However the content that I need to replace is correctly formatted html. It is shown in the database in php my admin like this?

    <div class="wow">
       <a href="blah"><span>Some text</span></a>
    </div>
    

    So how can I do a search and replace for this multiline content in the Beaver Builder data?

    How exactly do I search on space characters, tab characters and new line characters given there are no &nbsp; and /n or similar characters showing when I view the Beaver Builder data in the database?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Jamie

    (@codente)

    We responded to the same query in our community forum but posting here for others.

    You will most likely need a regular expression to find your HTML then you can search for tabs \t spaces \s etc.

    BSR does not support regular expressions and their latest version 1.4.4 is totally broken it does not work in serial data so you might want to give 1.4.3 a try first with your text.

    Failing that you will have to use a regex and wp-cli search-replace which does support regex

    You can use this site to test your regex skills https://regex101.com/`

    Thread Starter nicole2292

    (@nicole2292)

    Thanks very much for the response.

    Yes I am aware that the BSR is broken for serialized data on v1.4.4, so I was already testing with 1.4.3 prior to posting this.

    I will see how I go with regex but it’s not my strong point.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Search and replace for multiline html’ is closed to new replies.