Images Not Showing Up After Migration

Table of Contents

If your images are not showing up after a migration, or are being loaded from the wrong url, its most likely because they still have the old url in the database.

You can replace this in two ways.

Plugin #

You can use the "Better Search and Replace" plugin to fix broken images. Search for the old domain (ie, "") and then replace all occurrences with the new domain (ie, ""). We strongly recommend making a backup first before doing this.

phpMyAdmin #

From the panel, open up the "phpMyAdmin" option. Select the database where your WordPress site is stored and go to the "SQL" tab.

Enter the following line:

UPDATE wp_posts SET post_content=(REPLACE (post_content, '<old url>','<new url>'));

Replace "<old url>" with your old site url, or where the images are being loaded from. Replace "<new url>" with the url you want your new site to be on. For example, if my old site was "" and I want to move it to, I would do the following.

UPDATE wp_posts SET post_content=(REPLACE (post_content, '',''));