How to Fix Missing Image Links After a WordPress Migration

Have You just Migrate your site to new host or server? Or just changed your domain for some reason?

Later find out your image links in WordPress posts are missing. Don’t worry I will show you how you can fix it easily in less than under 5 minutes.

Method 1. Cpanel

If your host is offering Cpanel with your hosting account that is the fastest way to fix missing Images in posts and pages on the WordPress site. Follow the steps below

  • Log into your cPanel interface.
  • Once inside the cPanel, find the Databases category and click on the phpMyAdmin tool icon.

fix broken images

  • You are now on the main phpMyAdmin page. Find the newly added database and click on its name from the left-hand sidebar. Our sample database is named testdb.

 

  • This opens the database and the screen refreshes with a list of the tables. Using the sidebar again, find and click on the wp-posts table.

  • Look to the top of the screen and you will see several tabs that run across the page. Click on the SQL tab.

choose sql tab in phpmy admin

  • You are now on a MySQL editor screen. In the code area, copy the following bit of MySQL.
UPDATE wp_posts SET post_content=(REPLACE (post_content, 'old url','new url'))

[alert-warning]Be sure to replace the old site name and new site name with your actual website.[/alert-warning]

For instance, our original site was myoldwebsite.com and the new test site will be at wpglorify.com so the code should appear as in the picture below:

add mysql code

  • Click on the Go button to run the code and change the URLs for all images in the posts.

This will point all the old image links within the posts to the new domain.

Hope This Help to resolve the issue, If any problem during the process or want to add anything please let us know.

If you liked this article, then please give us thumbs up on Twitter and Facebook.

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *