views:

71

answers:

4

I recently moved a friends blog onto his new web hosts but unfortunately the images are not working.

This is due to the old host having the following path for images:

http://www.example.com/blog/wp-content/uploads/2009/07/imagename.jpg

The new host uses a different layout and has this path for the file:

http://www.example.com/wp-content/uploads/2009/07/imagename.jpg

'Blog' has been removed.

Does anyone know the easiest way to fix this issue?

+2  A: 

Use this query on your database:

UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com/blog','http://www.new-domain.com');
Greenie
+1  A: 

I've found this tutorial on Exporting and Importing Wordpress very helpful in such situations.

shipshape
A: 

Search RegEx is a good plugin to be able to search and replace with Grep through all posts and pages. Also look in template files for hardcoded links in the form of <>php bloginfo(); ?> for the unneeded /blog/ in the path.

songdogtech
A: 

Search replace is a good plugin as well as Search RegEx. Especially if your data to replace is widespread throughout your site. http://wordpress.org/extend/plugins/search-and-replace/

Joe Howard