Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I moved from Wordpress.com to my own Wordpress.org hosting. I had no problems importing all my posts over, and the images were all linked up fine.

Since the import, I decided to move my WP install from the root of HTML_public, to a new folder called Wordpress.

The posts are all still fine, but the picture links are still pointing to:

http://www.dekhoforum.com/wp-content/uploads/2010/12/father-christmas-raymond-briggs.jpg
When they should be pointing to:
http://www.dekhoforum.com/wordpress/wp-content/uploads/2010/12/father-christmas-raymond-briggs.jpg

I am assuming I must have missed out a step and should have not been so hasty in moving things around.

Is there an easy way to automatically update all pics in all posts to point to the new URLs? i.e. Add the new wordpress folder into each of the link URLs

dekho.com.au/blog/

share|improve this question
    
Well, the way I would do this would be to throw the latest version of phpMyAdmin on your server and export a copy of your database. Then use a text editor like Coda, Smultron, or Notepad++ to edit that file and run a find/replace on the URL. I'd love to answer this more completely now but I'm not on a computer that has programs for me to author up some screenshots. I'll be able to provide a more complete answer soon. –  Drew Gourley Apr 14 '11 at 4:21
add comment

1 Answer 1

up vote 3 down vote accepted

Search RegEx is a good plugin to be able to search and replace with Grep through all posts and pages to fix things like broken URLs.

And no need to export the DB and use a text editor; that's overkill for simply adding the /wordpress.

share|improve this answer
    
Oh I like this a lot! –  Drew Gourley Apr 14 '11 at 4:46
    
Worked for me. Very dangerous in the wrong hands though. Thanks –  Simon Apr 15 '11 at 3:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.