Find and replace

Lee

Well-known member
Morning.

I am looking for a way to carry out a find replace on the posts table of the database.

I want to search all posts for all instances of "url1.net" and replace them with "url2.net".

Is this a simple query to run?
 
Take a backup first.

SQL:
UPDATE xf_post SET message = REPLACE(message, 'http://www.old.com', 'https://new.co.uk');
 
Morning.

I am looking for a way to carry out a find replace on the posts table of the database.

I want to search all posts for all instances of "url1.net" and replace them with "url2.net".

Is this a simple query to run?
There's an addon for this:

It uses regular expressions for matching and replacing. If you're unfamiliar with those, this is a good site for testing:
 
Back
Top Bottom