Your WordPress images are broken after a domain change or a site transfer? Don’t worry, your images are NOT lost. Here is how to fix broken WordPress images.
When you are adding images into your posts or pages, WordPress inserts their full address paths (URLs) and stores them in the database. So, if you change your WordPress domain, site URL or folder where your WordPress installation is located, you need to adjust all of those image links accordingly.
Luckily, you don’t have to update all of your image links manually.
The easiest way of doing this is by using a plugin. Install and activate WP Migrate DB plugin.
WARNING: Before you continue, BACKUP your database!
STEP 1: On your WordPress dashboard sidebar go to Tools -> Migrate DB. This will open plugin’s settings page, which looks something like this:
Find fields will display your current WordPress site URL / domain and file path.
STEP 2: Click on Find & Replace radio button. This option will tell the plugin that you want to take the action on live database (the one you want to fix).
STEP 3: Next to the empty field that says “New file path”, there is a small X icon, click on it to remove that field.
STEP 4: In the remaining find field, instead of domain.tld or whatever shows in your case, enter your OLD WordPress site URL / domain. The one you used before the domain change or server transfer.
STEP 5: In the remaining replace field enter your CURRENT WordPress site URL / domain. The one you are using now, after the domain change or server transfer.
Now your plugin interface should look something like this:
This works for subdomains and folder paths as well, example:
STEP 6: After you are done, press the Find & Replace button at the bottom of the page to start the process. After the process of search and replace is finished, you will see the following message:
That is all, your image links should now be fixed! 🙂
You can now delete the plugin.
Regardless if you are a beginner or an expert WordPress developer, this is something you will have to or you already are doing very often. Hopefully, this tutorial will help you streamline your process of WordPress domain changing and site transferring, while keeping your websites fully functioning and stable. 🙂
Please leave a comment below and share your WordPress transfer experiences with us. What are your biggest issues with it? What approach do you use?
The easiest way to describe WordPress care services is to say that they bring peace of mind to WordPress site owners and save their time. But not only that, proper WordPress maintenance and monitoring can prevent a lot of potential problems on your website and make it perform faster and better, helping you attract and convert new clients.
What started in 2010 as a one-man web development operation is now a small and devoted team of web developers and server administrators.
Our focus is on WordPress hosting and WordPress care services such as speed optimizations, bug fixing and security hardening.
We are located in Croatia (Europe).
Our mission is to provide fast, stable and secure hosting environment for your WordPress websites, as well as professional WordPress care services and ongoing user support.
We believe that everybody deserves safe, stable and affordable hosting services. That is why our dedication, commitment and constant learning are reflecting that philosophy.