Fixing WordPress images Not showing up after migration

WordPress Images Not Showing Up After Migration? Fix it now

In Using WordPress by Fathi ArfaouiLeave a Comment

The WordPress migration process can be easy if you follow some basic tips and rules to avoid errors. But sometimes, the WordPress images will not showing up, again after a migration, and that’s a problem to solve in easy steps.

First, let’s understand why these images are broken after moving a blog to a new server or hosting.

If you’ve just moved the Blog files, but without changing the domain name, then, the problem was caused by missed images really, and the folder that contains these images is broken and you need to re-upload the folder manually.

In other cases, where you change the domain name of your blog, you need to replace all the old database URLs with the new ones. I’ll show you how to fix the problem in the following tutorial.

Images not showing after moving WordPress

Please note, I suppose all the cases, and I will show you how to solve each one of them. So, read the exact case that you have, or follow them, one by one.

1. Migration with the same domain

If you have moved the blog or website files to a new location, but with the same domain name, then, the problem can be caused by the “Uploads” folder itself, or a specific file inside it, and it’s the exact “month file”.

If you’re using one of the plugins that detect broken links, you can easily find the exact folder. Just see what is the month that is associated with the images URL.

Example yourwebsite.com/wp-content/uploads/2014/05/this-is-an-image.png

In this case, you can see that the month is “05” and you need to verify that exact file. So login to your cPanel account, and then, click on the ”File Manager” icon as the following screenshot.

cPanel File Manager

Now, you have the Blog files and you have to find the one called “wp-content” that contains the “Uploads” folder as the next screenshot.

find Uploads folder in wp-content

Now, you can see the WordPress uploaded files organized by month as in the next screenshot.

WordPress files by month

If you can see these months, then, the problem is one of these two cases:

  • The files are broken, or not existed and you should re-upload them manually (as below).
  • The file permissions are wrong, in this case, you have to select the files one by one, and click on “Change Permissions” at the top of the page, and make them “755” or “777” if that can’t help.

Upload the broken, or not existed image files

When you migrate a blog, it happens that a brief connection issue can break the entire folder, and especially for images. What you need is to have the Uploads folder in your computer from a backup, or an existing folder, on your old hosting server.

What we want to do is to replace that folder with another one that’s working. Please make sure remember that the folder contains all the blog images, and uploaded files before you’ve migrated.

Then, use the cPanel and click, “wp-content” as the above examples and delete the file “Upload” and upload another one as this example.

uploading working WordPress images

 

If you can’t upload the entire folder, you can upload the individual sub-folder that are the “months”, one by one, and make them in the exact order as the old folder, the same years and the same months.

If you’ve followed the above steps, and you have the same domain name, the WordPress blog images should work again, and you need to delete the blog cache if you’re using it, and the browser also.

Or, change the browser for better verification. If it’s not the case, and you still see broken images, see the below case where the issue was caused by the file permissions.

Change the file permissions

Some hosting servers can be configured with strict settings by default. If you get permissions errors in your images, and similar cases, then, all you have to do is to change the permissions, by selecting a file, or all of them, and then click on “Change Permissions”.

change permissions for image files

A small pop-up window will be shown, and you need to check the boxes to make them “755” or “777” if that doesn’t work.

updating image file permissions in Linux

When you finish with the files that cause the problem, come back to your blog, and delete the cache if you’re using a caching plugin, and also, visit your posts to see if all is working properly.

2. Images not showing after moving a blog to a different domain or directory

This is another case, where you change the blog URL address completely.

  • (Example: www.oldblog.com to www.newblog.com).

Or you move it to another directory, in the same server, or in a different hosting also.

  • Example: moving the blog from www.yourblog.com/wp to the new one www.yourblog.com or vice versa).

The problem is this, your old images are still pointing to the old URL, and that’s normal. In this case, you should update all the old blog URL with the new ones, and that’s can be done by 3 methods:

a/ Update the WordPress URL using a plugin

The first one is using the plugin Search and Replace, after installing activating it, you will find the plugin under “Tools” in your WordPress dashboard. It’s similar to the old plugin that’s gone now.

updating website domain in WordPress database

Then, you can replace all the old URL addresses, and make them point to the new URL of the domain name.

replace WordPress database urls

Also, you can use the plugin options to find a specific database table if you want. But, in general, you need to search the old URLs and makes them as the new blog address. Check the box” All-search/replace!” when you’re sure and you find the old URLs.

Please make sure that you’ve entered the exact new blog URL. At the same time save a copy of your database if something wrong happens. This process will modify the database tables, and you should be sure when you enter the Url.

b/ Fix the problem using an online tool

If your SQL database file is less than 5 MB in size, then, you can upload it to the “WordPress Serialized PHP Search and Replace” (search for it on Google) and add the old and the new domains, and the tool will make the necessary changes. Then, you can download your corrected database, and use it on the new server.

c/ Show your WordPress image again using SQL query

The second option that I recommend only for advanced users is to open your phpMyAdmin interface and just run the next SQL query:

UPDATE wp_posts set post_content=REPLACE(post_content, 'www.oldblog.com/', 'www.newblog.com/');

Then, the blog images will work again. The above solutions will solve your problem if the server is working properly, and there is nothing wrong with its configuration.

If you still get broken WordPress images, then, you have one single solution is to contact your hosting provider and show them some examples of your missed images, and any errors screenshots if you have them. That will help to fix the problem on their server.

If you’re hosting on a shared server, then it’s the time to think about a fully managed and premium hosting for WordPress. I recommend InMotion Hosting. That will not only speed up your blog and serve your images correctly, but it will help ranking better in Google for the super fast loading time.

I hope this helped and please share your own method that solved the WordPress image problems when moving websites to a new server.

I’m a WordPress expert with over 6 years of experience in solving problems with themes, plugins, code, and structure. Let e help you fix your blog or website issues through tutorials or contact me directly.

Leave a Comment