Last night I migrated one of my WordPress blogs to a new domain name. I used Joost De Valk’s simple and easy guidance Move your WordPress blog to a new domain in 10 steps with just a few minor variations to suit my circumstances.
Everything seemed fine last night but I gave it a fresh look this morning and noticed that the post thumbnails for the blog home page were not displaying at all. My blogs use the Thesis theme which lets you specify the thumbnail as a URL to the image file in the Write Post admin page. For some reason the .htaccess redirection for the old domain name was not working for the URLs configured on each post for the thumbnail image.
After a little snooping around in MySQL I found that Thesis stores this setting in the wp_postmeta table with a key name of thesis_thumb and a value of the URL itself. So the solution was as simple as performing a find/replace operation in MySQL. I made sure to backup my database first, then ran this SQL command:
update wp_postmeta set meta_value = replace(meta_value,'www.olddomain.com','www.newdomain.com');
After this I refreshed my browser and all of the thumbs reappeared on the home page.
If you found this post useful please leave a comment below. To receive new blog posts automatically subscribe for free to the mailing list or RSS feed.












{ 2 comments… read them below or add one }
Nice. It’s also handy for fixing up in post image URLs and links to previous posts. ;-)
Awesome! Was wondering how this was easily done. Thanks for saving me the searching!