Change WordPress post URLs in mysql

I’ve had to move word­press core and/or the wp-content direc­tory around before and I needed to change URLs within the post body to direct to the new loca­tion. Run­ning this query in mysql will update all of your post con­tent (links, images, etc.):

UPDATE wp_posts SET post_content = REPLACE(post_content, 'http://example.com/old-directory', 'http://example.com/new-directory');

You’ll also want to update the guid column

UPDATE wp_posts SET guid = REPLACE(guid, 'http://example.com/old-directory', 'http://example.com/new-directory');

Welcome!

Wel­come to my new web­site and blog space! This web­site will serve as a con­tin­u­ally updated port­fo­lio of my work and a space where I can track my own progress in dif­fer­ent cre­ative fields. I am hop­ing that the process of assem­bling all of my work and build­ing a web­site will help me to gain per­spec­tive on my advance­ments up to this point, and help me to focus my atten­tion on skills I want to improve. I would love to hear any com­ments and sug­ges­tions you might have. Enjoy!