How To Fix Broken Images WordPress

How To Fix Broken Images Wordpress

The way your theme displays images can be one of the biggest contributors to how people view your blog. 

Of course, you want an attractive design that looks great and gets all of the content in place that you need to convey but if your images don’t show up when they’re supposed to then none of the rest matters. 

This post is going to show you how to get things working again when you find that your images won’t load in the correct place on a WordPress theme.

WordPress Image not Displaying: 

Firstly, if your images aren’t showing up then there could be a number of different reasons for this, and we’re going to take a look at them each separately rather than jump straight into finding a solution. 

If your images were previously working and they suddenly stopped showing up then there’s a good chance that it’s related to the rest of the content on the page so we’re going to work through some other things before getting to fixing broken images in WordPress.

Make sure you have all of your images uploaded to your image library: 

If you don’t have images uploaded to the WordPress media library then you won’t be able to add them into any of your content, and that’s why we’re going to start by sorting out the images. 

The best place for uploading your images is on a computer rather than some other device like a phone or tablet, but it’s up to you which method you choose. If you have a computer and access to the internet then we recommend uploading them straight through WordPress: 

Go to your media library (usually found in the main menu somewhere), and click on the add new option. Upload your images from your computer and make sure that they’re saved in the correct format (.jpg or .png). Once you’ve done that, don’t add it to any posts yet. 

You need to make sure your files are named correctly: 

It’s really important to get this part right if you want your images to show up in the right place. WordPress automatically detects what type of file you’ve uploaded and it uses that as the name of the image. We’re not going to go into how things like this work, but what you need to know is that it’s looking for a few different pieces of information in your filename: Folder structure The type of file (eg; .jpg or .png) File number (starting from 01)

Now that you know this, you need to get your folder structure set up correctly. If it’s not done right then WordPress won’t be able to find your images when it looks for them in your content. 

An example of the incorrect way to name files: 

The location of the image is fine so we’ll skip over that bit but the first part should be either your site title or your blog name (depending on how you’ve set things up). 

After that, it should be /wp-content/uploads/image.jpg which is where your images are saved by default. The final bit of information is the file number which can just be given as 01 or 1 since it doesn’t really matter.

An example of the correct way to name files: 

The location of the image is fine so we’ll skip over that bit but the first part should be either your site title or your blog name (depending on how you’ve set things up). 

After that, it should be /wp-content/uploads/image-1.jpg which is where your images are saved by default and you can take the file number from there. 

Broken Image Links

What if when you add a post in WordPress that contains images, the images appear as broken links in the post body?

Solution;

The problem could be the file permissions, specifically the wp-content/uploads directory.

All subdirectories beneath it must have their file permissions set to 755. Additionally, all files in these directories must have their file permissions set to 644.

And to correct file permissions, you need to log into your cPanel File Manager.

Or use FTP.

Other issues you can fix;

Leave a comment

Your email address will not be published.