In this article, we will help you solve the problem of Magento 2 images not showing in just some simple steps.
If you are facing the problem that your images don’t display on your Magento 2 website, then you are at the right place.
There are some reasons that cause the issue to occur. And below, we will check all the points in depth.
Let’s go!
MAGENTO 2 IMAGES NOT SHOWING ISSUES AND HOW TO TREAT THEM
After surveying and reviewing common customer problems, we found that there are 2 main problem cases:
CASE 1: MAGENTO 2 IMAGES DON’T DISPLAY IN FRONT-END BUT DISPLAY IN THE ADMIN
-
REASON 1: YOU HAVE MISTAKEN PERMISSIONS IN YOUR /MEDIA/ FOLDER.
The solution regarding this point is to check whether writable permission is given to this folder or not.
Change the permission to 777.
You can do this using SSH through this command.
chmod -R 777 media/
-
REASON 2: MEDIA FOLDER IS OWNED BY ANOTHER OWNER.
It happens when switching Magento from one server to another.
The best solution is to change the ownership of /media/ folder.
You can do it by executing the code snippet below.
chown -R {username}:{username} media/
Note: Before switching, make sure the owner of the folder is the same as that of the web server user. If not, please contact your server guy for their support regarding ownership.
-
REASON 3: LOW PHP MEMORY LIMIT.
PHP memory limit plays an important role in resizing images in Magento 2.
Due to the low memory limit, Magento 2 cannot resize your images and will display placeholder images.
The solution for this is to increase your PHP memory limit.
Access the .htacess file. and find the given string below.
php_value memory_limit 256M
The value should be at least 256M and better be higher than 512M.
-
REASON 4: THE GD LIBRARY IS NOT INSTALLED OR CONFIGURED.
The solution is to check with the hosting provider as they have installed the GD library on the server.
CASE 2: MAGENTO 2 SAMPLE DATA IMAGES DON’T SHOW IN THE ADMIN
Mostly, it happens due to wrong permissions set to uploaded files.
To fix it, open lib/Varien/File/Uploader.php.
Check if the permission is set or not.
Around line 219:
chmod($destinationFile, 0666);
Around line 541:
if (!(@is_dir($destinationFolder) || @mkdir($destinationFolder, 0777, true))) {
THE BEST SOLUTION TO OPTIMIZE YOUR IMAGES
Needless to say, product images are such a crucial component of your Magento 2 store. However, depending on how you use your images, they can benefit or harm your website.
And the size of your images is a noteworthy aspect. It affects the website design, SEO and conversion rates.
Thus, you should keep all images on a single page to a total of 1 MB or less.
And to do it, it is recommended to use the WebP format to optimize the image size. WebP format can maintain the image’s quality but compress it to be around 30% smaller.
And hereby, we want to introduce you to the best solution to convert your product images to WebP format:
Magento 2 Convert Images to WebP by BSS

This extension allows you to convert all product images on your website to the WebP format with only a few clicks.
It also allows you to choose to change the image format on some specific page. For example, you can choose to convert images on the home page, product page, category page, or CMS page.
You can choose not to convert some specific images, too.
Highlight features:
- Automatically convert images under other formats (e.g., jpg, png, jpeg) to Webp to optimize the loading and display speed of your website.
- Choose specific places you want to convert your images to WebP format: All, Product Page, Category Page, Home Page, CMS Page.
- Reduce time spent on conversion, automate every media upload, and deliver better-looking images.
Conclusion
In this article, we have pointed out some reasons that lead to the issue of Magento 2 images not showing and how to fix them.
We hope this blog is helpful and good luck to you!
BSS Commerce is one of the leading Magento 2 extension providers and web development services in the world. With experienced and certified Magento developers, we commit to bringing high-quality products and services to optimize your business effectively. Furthermore, we offer FREE Installation – FREE 1-year Support and FREE Lifetime Update for every Magento extension.
CONTACT NOW to let us know your problems. We are willing to support you every time.