How to Update Image and Post URLs after moving WordPress to Root in Bulk
Though this is a 3D related website, a recent move from our ititial WordPress root directory (in this case hometheater3d.com/news ) to our sites main root ( hometheater3d.com ) brought up several technical issues that required quite a bit of skill (and research) to overcome.
The easiest way to accomplish this task is following the directions straight from wordpress here; http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory
One of the major issues with a blog of this size ( almost 1,000 posts as of this writing ) were the numerous permalinks embedded in our extensive media library of images and inside our posts.
In a nutshell, all of our Posts had links to graphics that had moved with the move;
The Permalink for an image of “Coraline” in one of our posts was set to;
http://hometheater3d.com/news/wp-content/uploads/2010/05/coraline-450×250.jpg
But after the move the file was located at;
http://hometheater3d.com/wp-content/uploads/2010/05/coraline-450×250.jpg
To make matters worse, the File Links themselves were set to the old permalink;
IE:
The old permalink;
http://hometheater3d.com/news/panasonic-offers-3d-movie-bundle-ice-age-dawn-of-the-dinosaurs-coraline-available-with-purchase-of-vt25-full-hd-plasma-tv/
stayed the same, even though WordPress automatically adjusted the Post’s Content to;
http://hometheater3d.com/panasonic-offers-3d-movie-bundle-ice-age-dawn-of-the-dinosaurs-coraline-available-with-purchase-of-vt25-full-hd-plasma-tv/
The general answer to this question all round the web is the labor intensive task of going into each post manually, clicking the images, clicking the edit icon, changing the permalink URL to the post, clicking advanced, changing the permalink URL to the Image and then clicking OK..
A thousand iterations of that would have me in a straight-jacket at worst, a weekend bender with Absinthe at best.
Now, the meat of the advice i have to give is this.. CHEAT. There is a great Plugin called “Search and Replace” by Frank Bültge.
Get the plug-in Here: ( http://wordpress.org/extend/plugins/search-and-replace/ )
What this plug-in does is very simple, it will go through the WordPress database’s posts and do a Find and replace operation on any content, including replacing the old Permalinks with the new ones! Yee-haa! (It replaced 2,200 permalinks on my site in under 30 seconds)
Now.. Some Warning.. Back up your database, this tool is fully automated and once you execute it, it runs and thats it. … No 2nd chances.
So.. here is how to do it;
After installing the plug-in; go to its GUI screen under Settings / Search and Replace.
Check ONLY the box for “Content”
In the “Replace” box, Type in the First part of the old URL permalink slug with the OLD wordpress Installation Root Location;
My Site was using:
http://www.homtheater3d.com/news/
In the “With” box, type the new location of the WordPress Root
My New Site is using:
http://www.homtheater3d.com/
_______________________________________
Then Press “GO”
This will, within seconds, take out the Old Path to the WordPress Root and replace it with a new for all images and Links within your site.
Good Luck!
-Tracy Atkins – Editor HomeTheater3D.com







