pictures

Find and Replace With phpMyAdmin (or using SQL)

hr
hr

Ever need to find and replace something in your WordPress database? (perhaps you changed domain names and have the old domain name or folder structure hard coded into some of your posts) You can easily update your database by using phpMyAdmin or by using the following code in any SQL interface:

SQL:
UPDATE wp_posts SET post_content = REPLACE(post_content,"http://olddomain.com/blog","newdomain.com/");

The first part of the command says "update the database table wp_posts" (where your content is stored). The later part of the command says "use the field "post_content" (where all your actual post content is stored" and then find "http://olddomain.com/blog" and replace it with "http://newdomain.com". You can find anything (not limited to domain name) and replace it with anything as well. This is a great time saver!

hr

Related Posts

Comments, Pingbacks and Tracebacks

(Comment icons use gravatars. Sign up for a gravatar so you can be cool too.)

hr

Leave a Reply


search

subscription information

Blog RSS

Comments RSS



Powered by FeedBlitz

blog categories

blog tags

most popular posts

  1. jappler recommends: room & board (store).
  2. using parallels and windows for web development debugging.
  3. another good first tuesday in november.
  4. remove all .svn directories in a directory.
  5. wordpress newsletter plugin.
  6. Add a "Pseudo" Pseudo Class Hover in Inline CSS.
  7. php live training.
  8. so long, farewell ben!
  9. css containers: one image, fixed width, rounded corners.
  10. feel better soon joe paterno.

blog archive

standards

Get Firefox!
XHTML
CSS