I have Magento 2 and want to hide small images of the product that is added from the admin on frontend. I have hidden the small image attribute from admin but want to hide it from front-end as well.

  • you can try simple css trick to hide Mar 28, 2018 at 12:02
  • Can you please tell how @Manoj Deswal Mar 28, 2018 at 12:21
  • you can try with code as well , check solution and let me know if any problem , i just checked it on luma based theme and it works Mar 28, 2018 at 12:36
  • Your code seems to be working but not as I want. It has hidden all the thumbnails. Mar 28, 2018 at 13:19
  • oh I mistaken , could you please share some screenshots...so that will easy to know the right question Mar 29, 2018 at 3:28

2 Answers 2


You can try with either CODE or CSS

1) Changing / Adding code in your extended view.xml

Can find at below path or if not present then you can create


Add below code

<vars module="Magento_Catalog">
    <var name="gallery">
        <var name="nav">false</var> <!-- Gallery navigation style (false/thumbs/dots) -->

Keep your cache disable or clear your cache

2) Using CSS in you custom style sheet


Perform whatever things you do for using custom CSS to work

I hope this will get you desired solution

  • Sorry, But i think you did not completely get my point. When we add the image from admin then we have the various image attributes like Small, Base, Thumbnail etc. I want to hide the images that has "Small" as an attribute on product view page. Mar 28, 2018 at 13:17
  • @A.Srivastava do you get the sollutionn to hide small selected images from frontend ? Dec 20, 2019 at 11:19

In admin panel product level,

when you are uploading the image and setting role as small in the same time choose Hide from Product Page checkbox as well.

then flush the cache and see result you will get your expected output (Your will not get small image in product detail page).

Reference Image

  • Seems broken either in 2.3.2 or some extension broke it.
    – dawhoo
    Sep 20, 2019 at 22:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.