Title: Site-wide string search/replace
Last modified: August 18, 2016

---

# Site-wide string search/replace

 *  [heroofspielburg](https://wordpress.org/support/users/heroofspielburg/)
 * (@heroofspielburg)
 * [19 years, 2 months ago](https://wordpress.org/support/topic/site-wide-string-searchreplace/)
 * Hello,
 * I’m new to the database paradigm for blogging, so please excuse the ignorance
   of my question.
 * Does anyone know a way to do a site-wide search and replace for a string? For
   example, go through all posts, find “[http://mysite.com/blah&#8221](http://mysite.com/blah&#8221);
   and change to “/bleh”.
 * Thanks for the help!

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [drmike](https://wordpress.org/support/users/drmike/)
 * (@drmike)
 * [19 years, 2 months ago](https://wordpress.org/support/topic/site-wide-string-searchreplace/#post-538355)
 * Why not just export out the database, run a search and replace using a text editor
   like Ultraedit, and reimport it?
 *  Thread Starter [heroofspielburg](https://wordpress.org/support/users/heroofspielburg/)
 * (@heroofspielburg)
 * [19 years, 2 months ago](https://wordpress.org/support/topic/site-wide-string-searchreplace/#post-538421)
 * I suppose that may be what I’ll have to do. I’ve never opened up a SQL db before,
   and I was a little leery of doing so and then reintegrating it to WordPress.
 * I was hoping there was already some kind of WP-side interface for something like
   this, but I guess I have to jump and make it happen.
 * Thanks.
 *  [Les Bessant](https://wordpress.org/support/users/lesbessant/)
 * (@lesbessant)
 * [19 years, 2 months ago](https://wordpress.org/support/topic/site-wide-string-searchreplace/#post-538422)
 * There is a [Search and Replace Plugin](http://thedeadone.net/software/search-and-replace-wordpress-plugin/),
   which does direct database updates.
 * I’ve used it a couple of times, and it does what it says it will. As with anything
   that can make major changes, make sure you have a backup of your database first.
 *  [jabash](https://wordpress.org/support/users/jabash/)
 * (@jabash)
 * [18 years, 11 months ago](https://wordpress.org/support/topic/site-wide-string-searchreplace/#post-538567)
 * I have the same issue and S and R pluging does not do it for me. For one thing
   it is all in German. I tried just doing a search without replace and didn’t get
   any hits.
 * I am moving my images to a Gallery 2 system and need to change the photo links
   in the posts.
 * Any other suggestions?
 *  [Pizdin Dim](https://wordpress.org/support/users/pizdin_dim/)
 * (@pizdin_dim)
 * [18 years, 11 months ago](https://wordpress.org/support/topic/site-wide-string-searchreplace/#post-538568)
 * This SQL update query will work, assuming your table is called “wp_posts”, the
   old string is “[http://mysite.com/blah&#8221](http://mysite.com/blah&#8221); 
   and the new string is “/bleh”:
 * `update wp_posts set post_content = replace(post_content, 'http://mysite.com/
   blah', '/bleh');`
 * You will need the MySQL client tool or something like phpmyadmin.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Site-wide string search/replace’ is closed to new replies.

## Tags

 * [posts](https://wordpress.org/support/topic-tag/posts/)
 * [string](https://wordpress.org/support/topic-tag/string/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 5 participants
 * Last reply from: [Pizdin Dim](https://wordpress.org/support/users/pizdin_dim/)
 * Last activity: [18 years, 11 months ago](https://wordpress.org/support/topic/site-wide-string-searchreplace/#post-538568)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
