Most of the time users are facing images not showing issues after WordPress migration. This is one common issue that appears due to the wrong home or site URL location on the website. If there is a difference in the domain name during the migration, the home & site URLs need to update to the new one.
This is a common cause of images not showing after WordPress migration because it reflects website URL redirects to the old one or the dashboard will not load. If in case, the WordPress dashboard is accessible, you can easily fix the home & site URL from the setting page of WordPress. Here in this blog, we have shared information about why images not showing after WordPress migration. Spend your 2 minutes to read this article & resolve the issue.
Why do images not show in WordPress?
There are some reasons for images to disappear from WordPress. The most common reasons are:-
- Wrong home & site URL
- Wrong image URL
- Wrong references in image URL
- Plugin matches
- An issue with the image title
- Wrong permalink setup
- Incorrect file permission or request
1. Wrong home and site URL
Incorrect home and site URLs can cause the images on the home page to disappear, the website to redirect to the old one, or actually the dashboard to not load. If the WordPress dashboard is available, the home and site URL can be fixed easily from the General sets page in Settings. Also, If the dashboard is not available, it should be fixed by adding WP_SITEURL and WP_HOME URLs in wp-config.php with the existing path of WordPress. This is added in the configuration below:-
2. Wrong image URLs
Images are instanced as URLs in the WordPress database. When there is a differentiation in the domain heading during migration, the image URLs also need to be corrected to that of the new domain title. Most of WordPress migration plugins complete this step automatically. But it was a manual migration, the image URLs need to be edited singly. The simple method here is to use a find-and-replace plugin.
We can also modify the image URLs manually from the wp_post table in the database. If it is a WHM server, then this can be instantly done from the SQL option in the PHPMyAdmin for the connected database using the controls below:
UPDATE wp_posts SET post_content=(RETURN (post_content, ‘<old url>’,'<new url>’));
3. Wrong references in image URL
Images can depart at the destination of the website migration if SSL is established at the destination host and the images are tough-coded over HTTP://. Some of the SSL plugins can also generate this issue. It can be resolved easily by modifying the HTTP://connection to HTTPS://. The search and return plugin or the PHPMY admin process mentioned above can be used to fix this.
4. Plugin matches
Some of the plugins that performed really well in the origin server may fail to deliver the same performance in the new domain due to little differences in the working conditions. This at times generates images to depart from the website. Some of the plugin locations require to be changed to resolve the issue. PHP or other server-wide locations may also require to be changed to complete the image visual on the website also. We at Bobcares consistently examine the log files to find the same plugin and the settings that pitch the error.
5. An issue with the image title
Established on the PHP performance used by the website, some of the symbols, particularly special symbols may not be sponsored by the server. Therefore the file name for the image contains any such qualities, which may fail to deliver on the website. The easiest fix at this phase is to try modifying the file name to another one that does not include any such symbols.
6. Wrong permalink setup
If the permalink setup at the origin and destination of the migration is separate, it can generate the images to depart. Permalink setup can be efficiently restored from the Permalinks section in the Locations area of the WordPress dashboard.
7. Incorrect file permission or request
A directory would preferably require 755 permission, and files will require 644 permission to be fixable by WordPress. If there is any difference in this permission, WordPress may fail to produce images on the website. Even, it is necessary to modify the ownership, of the files to check the server settings, after removing the backup file. Modifying these settings to the suggested values will instantly fix the problem with the pictures.
How to fix the Image not showing issue after WordPress migration
Follow the below steps to resolve the image not showing issue after WordPress migration,
Step 1: Log in to your cPanel interface
Step 2: Once inside the cPanel, see the database class and click on the PHPMY Admin tool idol.
Step 3: You are on the leading PHPMY Admin page. Find the recently added database and click on its title from the left-hand sidebar.
Step 4: This opens the database and the screen restores with a list of the tables. Using the sidebar again, search and click on the wp-posts table.
Step 5: Examine the top of the screen and you will notice some tabs that run across the page. Click on the SQL tab.
Step 6: You are currently on an MYSQL editor page. In the code area, copy the subsequent bit of MYSQL.
Update wp_posts SET post_content = (Replace(post_content,”,”));
Be confirmed to return it with the old Sitename and with the latest site name. For example, our initial site was WpGlobalSupport.com and the recent trial site is GlobalWpSupport.com so the code should occur as below;
Update wp_posts Set post_content= (Replace(post_content,”WpGlobalSupport.com’,’GlobalWpSupport.com’));
Click on the go control to execute the code and modify the URLs for all images in the posts. This will also- impact any other ‘hard coded’ links that existed in the posts that were suggested to the original site.
Below are before and after images of the modifications made. Note that the image paths are shown in the lower left-hand corners of the images. You can see how they changed to the new site name after the SQL code run.
A few important points you need to know
- Maybe the images have the old URLs reserved in the database. So you have to modify all the old URLs to recall the new URL. You can use a plugin for this.
- Moving a site from one domain to a different domain needs you to replace the domain name in all the links in posts/pages. This can be accomplished using a database search and restore.
You must use the migration plugin if you are not knowledgeable about the database updates needed
To fill up, images can disappear from the WordPress website through migration due to many explanations. It is necessary to determine the actual reason to get the images back. Today, we are concerned about common causes that can generate the images to disappear and how our WordPress support brings back images in every case.