Have you recently migrated your WordPress website to a new domain, and the images not showing up. It might look like a big problem and some people might end up creating a whole new website just to avoid this problem. The solution to this problem is quite simple. Let us first look into the reason to this problem and then solve it.
Reason of Images not showing in WordPress Website After migration – It is because the link to the images shown in the posts is still bind with the old domain. Sometimes if the old website still exist, your new website will be showing the images from the old website. As soon as the old website goes down you will start facing this problem. In such cases you must make sure that your website images are from the new links and not from the old ones. You can do it just by a right click on the image and click on “Open image in new tab”. Check the URL of the image if it is from the new domain.
How to resolve this problem of Images not showing in WordPress Website After migration – To resolve this problem you should have access to the database of your website. Follow the following steps to resolve this Image not showing problem in one go for all the images:
- Open the phpMyadmin tool in cPanel.
- Open the respective database.
- To be on the safer side take a backup of the database by clicking on the export tab on the top.
- Now find the table wp-posts and open it.
- See at the top of the screen and you will find a tab named SQL, click on that tab. It will open an editor window where you can type and SQL.
- In the code are copy the following SQL query –
UPDATE wp_posts SET post_content=(REPLACE (post_content, ‘old domain’,’new domain ‘));
- By running this SQL you will replace the old domain by new domain in the post table for all the links.
- Click on the go button and the job is done. This process will also effect any other links to the old domain.