MyBB Community Forums

Full Version: replace the URL in your posts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How to use MySQL to replace the URL in your posts?!
So you want a query that will replace all links in post with something else? Can you elaborate please.
yes a something like this:

UPDATE wp_posts SET POST_CONTENT = replace(POST_CONTENT, 'myolddomain.com', 'localhost/sandbox');

its for wordpres but this not work on mybb
I have never user a query like this.
Have you tried this?
UPDATE mybb_posts SET message = replace(message, 'myolddomain.com', 'localhost/sandbox')
Thank you
worked Big Grin
Your welcome, glad to be of help. Smile
Make sure to have a backup before running any such queries on post messages. So you can undo in case anything goes wrong.
Yeah I would do that. The OP had already said that they had tried it and I guessed that if they had tried it and it hadn't worked and nothing had gone wrong, that trying one that should work wouldn't do any damage.
Slightly off topic, but perhaps it would be nice if MyBB could detect posted internal URLs and only store them as relative URLs. Would make domain movements a bit nicer.