How to Perform a Conditional Search & Replace in WordPress?

Joined
Nov 30, 2015
Messages
40
Likes
29
Degree
0
How would you guys go about conditional search replace in WordPress?

Say I've got 100 posts titled "[Product] Characteristics" with [Product] all over the Post Content.

I've cloned all of these 100 pages and now I want to do a conditional search replace based on [Product] on both the actual Title & Post Content. Foreach new cloned page, I want to add a 2.0 at the end. So I would now be "[Product] 2.0". How can I go about that?

The only way I see of doing this is pulling all the posts on a for each loop, get the [Product] using simple regex from the title and then search & replace all over the post content & title.

Any other faster/simpler way maybe using a plugin?

Thanks guys
 
Back