WordPress migrations can be performed flawlessly if a few tips are kept in mind.
A common issue faced after a manual WordPress migration is missing images. Images will be present in the backend, however, it won’t show up in the WordPress dashboard or on the website.
As a part of our Server Management Services, we perform WordPress migrations almost every day for web hosts, data centers, eCommerce companies, and other businesses. And this image missing error comes up occasionally during these migrations.
Today, let us discuss the possible causes of this issue and how we fix it at our end.
Why do images disappear from WordPress?
There are several reasons for images to disappear from WordPress. The most common ones are:
- Incorrect home and site URL.
- Incorrect image URLs.
- Incorrect references in image URLs.
- Incorrect permalink setup.
- Plugin Conflicts.
- Problem with image name
- Wrong file permission or ownership.
Incorrect home and site URL
The most common reason for missing images after a WordPress migration is incorrect Home and site URL settings provided for the website.
If there is a change in the domain name during migration, the home and site URL of WordPress website needs to be updated to the new one.
Incorrect home and site URLs can cause the images in the home page to disappear, the website to redirect to the old one or even the dashboard to not load.
If the WordPress dashboard is accessible, the home and site URL can be fixed easily from the General settings page in Settings.
If the dashboard is not accessible, it should be corrected by adding WP_SITEURL and WP_HOME URLs in wp-config.php with the current path of WordPress. This is added in the format below:
define('WP_HOME','https://example.com'); define('WP_SITEURL','https://example.com');
Incorrect image URLs
Images are referenced as URLs in the WordPress database. When there is a change in the domain name during migration, the image URLs also need to be updated to that of the new domain name.
Most of the WordPress migration plugins perform this step automatically. But if it was a manual migration, the image URLs need to be updated separately. The easiest way here is to use a search and replace plugin.
We can also change the image URLs manually from the wp_posts table in the database. If it is WHM server, then this can be directly done from SQL option in the PHPMyAdmin for the corresponding database using the commands below:
UPDATE wp_posts SET post_content=(REPLACE (post_content, ‘<old url>’,'<new url>’));
Incorrect references in image URLs
Images can disappear at the destination of the website migration if SSL is installed at the destination host and the images are hard-coded over http://. Some of the SSL plugins can also cause this issue.
It can be fixed easily by changing the http:// references to https://. The search and replace plugin or the PHPMyAdmin method mentioned above can be used to fix this.
Incorrect permalink setup
If the permalink setup at the source and destination of the migration is different, it can cause the images to disappear.
Permalink setup can be easily corrected from the Permalinks section in the Settings area of the WordPress dashboard.
Plugin Conflicts
Some of the plugins that worked really well in the source server may fail to show the same performance in the new environment due to minor changes in the working environment. This at times causes images to disappear from the website.
Some of the plugin’s settings need to be adjusted to fix the issue. PHP or other server-wide settings may also need to be adjusted to make the image visible on the website again.
We at Bobcares systematically analyzes the log files to locate the exact plugin and the settings that throw the error.
Problem with image name
Based on the PHP version used by the website, some of the characters, especially special characters may not be supported by the server. Thus if the file name for the image includes any such character, it may fail to deliver on the website.
The simplest fix for at this stage is to try changing the file name to another one that does not contain any such character.
Wrong file permission or ownership
A directory would ideally need 755 permission, and files will need 644 permission to be retrievable by WordPress. If there is any change in this permission, WordPress may fail to deliver images on the website.
Also, it is important to change the ownership of the files to match that of the server settings, after extracting the backup file. Changing these settings to the recommended values will immediately fix the issue with the images.
Conclusion
To sum up, images can disappear from the WordPress website during migration due to many reasons. It is important to identify the exact reason to bring the images back. Today, we discussed common reasons that can cause the images to disappear and how our Support Engineers bring back images in each case.
it is very good information but it doesn’t work in my case. Actually, my website site URL is correct but does not show images. Databases are correct. After normal migration my website images not showing
Hello Shibins,
If you are still facing the issue, We’ll be happy to talk to you on chat (click on the icon at right-bottom).
Hello!
I had a designer that converted my WPBakery home page to Elementor.
When doing so, all the home page was transfer as a code to Elementor so now, when I try to replace an image in the home using Elementor all I see is a huge code, and the images are showing like a number, for example: 1725 or 1726. I tried erasing the number and replacing with the url of the new image but it doesn’t work.
Can you please help me?? If you could explain to me the best way to replace images when you migrate a page from Bakery to Elementor and you see averything as a huge code and the images are numbers instead for a url?
Thank you so much for your time and have a great day
Hi,
Our experts can help you with the issue.we will be happy to talk to you through our live chat(click on the icon at right-bottom).
HI i have this case of missing image on one of my website https://houseofaroma.in/
we had to manually uplaod each image which went missing but after few day some other images went missing
Hi,
Our experts can help you with the issue.we will be happy to talk to you through our live chat(click on the icon at right-bottom).