This morning, I attempted a simple WordPress Export and Import of roughly 100 posts from a client’s old WordPress blog to his new one. I quickly discovered a major error using the official WordPress Import plugin. While all the posts imported just fine, the option “Download and import file attachments” did not work. This was due to images being embedded into the post. Oddly enough, I found that some of the images did import, however, the file paths did not change.
Frustrated, I reached out to the local WordPress community to see if anyone had experienced this before. I received a few responses, however, one from @Cheffheid had me take a step back and say, well duh! He pointed out a very simple fix, move the contents of the upload folder to the new server and replace all the links. Very simple fix.
Step by Step WordPress Import Download and Import File Attachments Fix
- As with all work on a WordPress site, first backup everything.
- Export posts from old WordPress blog.
- Import posts to new WordPress blog with WordPress Import plugin. Do not select “Download and import file attachments”.
- FTP into old WordPress blog and download the contents of /wp-content/uploads/.
- FTP into new WordPress blog and upload those contents into /wp-content/uploads/
- Use INTERCONNECTIT Search and Replace to do a search & replace across your database. Search for “http://olddomain.com/wp-content/uploads/” and replace with “http://newdomain/wp-content/uploads/”. Change the URLs above to match the path your uploads directory.
- Remove INTERCONNECTIT from your server for security reasons.
- Test everything.
While there are WordPress Import tools that will import images and file attachments, many I have found either did not work or had a premium fee. The option above will not cost you anything but a few minutes of your time.