cut off bbcodes with phpmyadmin search and replace


Well-known member
I have made a mistake of epic stupidity. It's really amazing.

Instead of simply making a new custom bbcode for [youtube] I somehow thought it was a good idea to do a search and replace in phpmyadmin to remove the tags. Wow was that stupid. I've ended up with hordes of video posts with simply the following content like this:


I might win the idiot admin award, I know, I know.

So what are my options here? I appears I need a regular expression because there is no common identifier on the front and then somehow append the [youtube] bbcode back.


Well-known member
Using phpMyAdmin, go to a message with a YouTube tag, do a screen print and post the image here for us to see.


Well-known member
Once you install the Post Content Find and Replace add-on, you will want to do this:





Well-known member
I've never used it, but MySQL implements a way to use regular expressions:

Would alleviate your problem with PHP memory if you can run it straight against the database.

Though if you just run the PHP tool over and over and over again it should eventually fix everything (each time it should convert records until it runs out of memory)... but it's going to impact your server performance doing that.