2

I am about to change themes on my site and also a plugin that creates tabs with a post.

I need to replace multi-line text with other multi-line text and can't work out how to do it.

I have tried "/r/n" but that doesn't seem to work.

Here is an example:

I need to replace

[tabs]
[tab title="1024x576"]
<table class="screenshot-table">

with

[tabby title="1024 x 576"]
<table class="screenshot-table tentwentyfour">

Here is an example of what I have tried:

update wp_posts set post_content = replace(post_content, '[tabs]/r/n[tab title="1024x576"]/r/n<table class="screenshot-table">', '[tabby title="1024 x 576"]/r/n<table class="screenshot-table tentwentyfour">');

TIA Phillip

  • 1
    Shouldn’t that be \r\n? – fuxia Jan 7 '15 at 8:10
  • Yes, probably! DOH! – PlanetPhillip Jan 7 '15 at 8:32
4

Okay, this always seems to happen to me. I spend ages looking for an answer and finally decide to give up and post here and then one more search finds enough to solve it.

Anyway, this is what worked for me:

update wp_posts set post_content = replace(post_content, '[/tab] 
[tab title="1024x576"]
<table class="screenshot-table">', '[tabby title="1024 x 576"]
<table class="screenshot-table onetwentyfour">');

Simply by putting the multi-line text ON multi-lines worked.

You learn something everyday!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.