September 21, 2022

How To Export & Import a WordPress Blog and All Images

By Todd Farino

One of the biggest challenges in migrating a web site or giving an old web site a new design is migrating your WordPress blog. For many developers this has been a constant source of frustration.  You would think it would be relatively simple to export and import a blog, but certainly challenges arise, particularly with the images.  Images, no matter how many times you try, will not import with the blog.  Most blogs have hundreds of images, and every blog should have a featured image.  It is critical we get all this photos to move over as to not negatively affect your Google SEO rankings.  In this article, I will show you how to successfully migrate your blog and the photos to your new site or hosting server.

Migrating the blog

1. It is always best to make sure both sites are fully updated to the latest version of WordPress and your latest theme update. I would even make sure any plugins are updated.

2. Before we import/export the blog is make sure that your admin usernames on both sites match and have the same passwords. This is critical for the WordPress import/export operation to be able to access the media later in this process.

3. Go to the original site with the blog you will export and in the dashboard go to Tools >> Export.  Choose to export ALL posts and then click “download export file”.

WordPress Dashboard >>Tools >> Export

4. Now that you have the blog file, go to the new site WordPress dashboard. Select Tools>> Import.  It will ask you to select which type of importer to install as a plugin on your site.  Select WordPress and click on “Install Now”.  This will install the import plugin and then you can upload your blog export from the original site. It will ask you who to assign the blogs too for the new site.  Make sure you assign them to the same admin on the original site.  The admins have to match.

5. After you have successfully imported the blog or anything for that matter, you will see the following message (image to right)

6. Before we go forward, we need to prevent your hosting server from timing out too soon. Most hosting servers are set to 30 seconds or 300 seconds, but we will make it 3000 seconds to avoid timing out while uploading blog photos.  This is not a MUST DO, but if you can I strongly recommend it. If you have access to your hosting account, log in and go to your Cpanel. Click on “Select PHP Version”. Once in there, click on

7. In PHP Options, look for max_execution_time and update it to 3000 (Seconds). It should autosave. After that, close your hosting and go back to the original site to start the export of media.

8. Back at the original site, go to Tools>> Export. In the list, this time we choose media. For this export option, WordPress will ask for a date range.  You will input a start and end date for the export.  They ask for the date range because trying to export all your images at once could cause both web servers to crash or simply timeout.   Based on the number of photos you have on your site, that will determine how many months you can grab at once.  I would recommend starting with the first month (the very first images) and only ending on the next month.  Like this: (image to the right)

9. After you download the export file (xml), go back to the new site and select Tools>> Import and select your file for import. Before the import begins, WordPress will ask which user would you like to make the owner of the new imported media. ALWAYS CHOOSE THE SAME ADMIN that is on the original site. Make sure you Check the box for “Download and import file attachments”.  Click submit and wait.

10. Depending on the size of the download, it could take 1 to 3 minutes.  Sometimes more.  If you get a 404 error, especially if it comes quickly, just repeat step 9.  It shouldn’t happen more than twice and if it does, you have to look at your hosting because it could be overloading your processing capacity, but that is rare.  Even if it happens 2 minutes in, repeat step 9 with the same file.  It will not duplicate image in your media library.

11. Once you see the message, “All done. Have Fun!”, you have completed that import.  Next, go to the media library and check to see if new media files were added by viewing the total number of media items.  You can also, search by going to the last images because if you imported the earliest images, they will be the oldest in your media folder.

12. Delete any images you don’t want, like old web site images that do not pertain to the blog itself.  This will help to keep your media file clean and lite.

13. Repeat Steps 8-12 until you have grabbed all the months/years of your blog.  You can try taking more months, maybe 2-3, but if it causes timeout errors, just reduce the number of months that you export.

This is the sure fired way to move your all your media from one site to another, but more importantly, it keeps all the image meta data, so it correctly corresponds with the blog post in belongs too.  Performing the import/export operation changes nothing in the files, and that is most important.

Granted this will give you more images than you want since it will include all web site images, the key is to get your blog moved with no seriously design or SEO impact.

For full disclosure, I ran this operation on blogs with over 500 images in the media file. I ended up deleting about 100 images I did not need for the new site. Moving a blog can be a tough task, but you cannot mess around with it.  You need the blog and all the images within it, including featured images.  If those images aren’t moved over it can severely impact your SEO.

For more great tips, check us out at