0

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/

1
  • 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. Apr 14, 2011 at 4:21

2 Answers 2

3

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.

2
  • Oh I like this a lot! Apr 14, 2011 at 4:46
  • Worked for me. Very dangerous in the wrong hands though. Thanks
    – jakc
    Apr 15, 2011 at 3:29
0

Also, you can apply on your database something like:

update wp_posts 
set post_content = 
replace(post_content, 'site.test.net/old_folder', 'site.test.net/new_folder' );

of course use carefully.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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