The process of moving 100’s of blog posts from one WordPress website build to anther can either be simple and ONLY take a few minutes…. OR it can be painful and take an excessive number of hours or days!
Chances are if you are reading this article you know about the exporter and importer tool that is built inside WordPress…. BUT you have noticed that it only moves the text for each post, but does not move the images. If you think it does or looks like it has, check (inspect) the URL’s of the images. You’ll notice that they are still ‘absolute URLs’ from the site/ domain that you moved (exported) the posts from.
Same too if you are moving pages or any other content type that the exporter tool lets you export.
Here’s a quick tutorial on how to move images (without doing it manually… which would take WAY, WAY too long if you have hundreds of blog posts to move):
Step 1: First, let’s assume you have already exported the posts and you have downloaded the export file (the XML file). If you don’t know how to do this, just Google it. It’s easy.
Tip: if you use the Yoast SEO plugin (the free or premium version) on your old site and set up the exact same version on the new site (before importing the XML file), your meta-data will also import. Another great time saver!
Step 2: You’ll then need to log in to your new website build and use the import tool to import the XML file. Then use the import tool. THEN, check your work. You’ll notice that the images inside the blog posts look like they have imported as well (maybe even the featured images… though this is not always the case). HOWEVER look again; by inspecting the code to see where the images are living, you will see that they did not actually import into the media library/ file manager of your new website. Instead, they will just be ‘absolute URLs’ linking to your old domain. SO… what to do??
There are a few options. Yes, you could FTP into your old domain and download the media library folders and upload them into the new domain… and then use a find and replace tool to change all domain names in the database on the new site… so the paths are updated and the images are now displaying from the new domain rather than the old domain (if you follow). BUT that seems like too much munching around for my liking! It would not be too bad though if the domain name is not changing — as in, if you are creating a new website to replace an old website and the website address/domain name is not being changed. But still, this really is a bit involved! Thankfully there is an easier way that works. You need a plugin to do it and it’s easy to use. You will find the instruction on how to this here… including the name of the plugin.
What about featured post images?
Often when you or someone else redesigns your blog, the size of the featured image will change. If you want them to look their best, you’ll need to grab their original versions and resize them in a program like Photoshop… then re-optimise and re-add them into each post.
If you know of a short-cut way to do this automated using bulk actions, scripts or some other plugin, please share this with us in the comments.
As yet, we have not had to figure out a way to do this ‘automated’. If and when we do, we’ll update this blog article.
What about Shortcode cleanup?
Once you’ve imported your blog posts (and/or pages) and you find there is shortcode displaying in them…. don’t worry. Nowadays here are Plugins that will clean-up the shortcodes. If your old site used WP Baker builder, use this plugin method.
If your old site was using Divi, there are plugins that cleanup shortcode from Divi sites too. Just do a Google search and you will find them. The above-mentioned plugin may also work, but I have not tried it. Feel free to experiment. I would recommend doing experimentation on a ‘sandbox staging server’ version of your website, NOT on your live site.
What about text hyperlinks within posts and pages?
If you are internal linking pages and posts within your website and need to update their URLs (that is, only if your Domain Name has changed) you could try an automated process for that too. Personally I have not had to do this but if you do, just do a google search and see what solutions you can find. If you want to post them in the below comments, please feel free. I myself would probably try using the ‘Better Search and Replace‘ plugin… but I cannot make any guarantees that this will work 100% of the time.