Shopify Product Gallery: How to Hide Your First Main Image Like a Pro (Community Insights!)
Hey there, fellow store owners! Ever found yourself wanting to tweak something just a little on your Shopify store, only to discover it’s not quite as straightforward as clicking a button? You’re not alone! I recently dove into a fascinating discussion on the Shopify community forums that really highlighted this. The topic? A store owner, JustinasR, simply wanted to know: "How do I hide the first main product image in the product photo gallery?"
It sounds simple, right? But as the thread unfolded, it became a great example of how different themes and approaches can lead to different solutions. Let's break down what the community experts shared and how you can apply these insights to your own store.
Why Would You Want to Hide the First Image?
Before we jump into the 'how,' it's worth considering the 'why.' As Priyasha and DiegoCosta2428 pointed out in the discussion, the first image isn't just for your product page gallery. It's often what Shopify uses for:
- Collection pages
- Cart and checkout pages
- Social media previews
- Search engine results
So, wanting to hide it on the product page, but maybe keep it for other uses, adds a layer of complexity. Or perhaps you have a hero image for the product page that you don't want to show up in the gallery itself. Whatever your reason, the community had some excellent solutions.
Solution 1: The Simplest Approach (No Code Needed!)
Sometimes, the easiest fix is the best. Both Priyasha and DiegoCosta2428 highlighted this, and honestly, it's where I'd start first. If the image just shouldn't be first, or shouldn't be there at all:
Option A: Reorder Your Product Media
If the image is fine, but just not suitable for the *first* spot in the gallery, you can simply change its position. This is a super clean fix because it updates everywhere Shopify uses that 'first image' – collections, social shares, etc.
- Go to your Shopify admin.
- Navigate to Products and select the product you want to edit.
- Scroll down to the Media section.
- Click and drag any other image to the first position.
- Click Save.
Option B: Remove the Image Entirely
If you genuinely don't need that photo at all, as v.marychenka suggested, just delete it.
- Go to your Shopify admin.
- Navigate to Products and select the product.
- In the Media section, tick the checkbox next to the image you want to remove.
- Click Delete file or Remove (depending on your Shopify version).
- Click Save.
Solution 2: Hiding with Custom CSS (The Community's Go-To)
Now, if you *do* want the image to exist but just not show up in the product page gallery, CSS is your friend. However, as the thread proved, this isn't a one-size-fits-all solution. Different themes use different class names and data attributes.
Sam_Expertise001 kicked off the CSS discussion, suggesting a general approach, but it was Ploqo and jowel-66 who really drilled down into a working solution for JustinasR's specific theme, Roam 5.0.0, after some trial and error (which is totally normal in custom coding!).
Steps to Add Custom CSS (Tested on Roam Theme)
This method hides both the main image and its corresponding thumbnail in the gallery. Remember, this example is tailored for the Roam theme. If you're on a different theme (like Dawn, for instance), you might need to use your browser's 'Inspect' tool to find the correct selectors, as Sam_Expertise001 advised.
- Go to your Shopify admin.
- Navigate to Online Store > Themes.
- Find your current theme and click the … (three dots) button, then select Edit code. (Alternatively, for simpler themes, you might find a Custom CSS section directly in Theme settings, as Ploqo demonstrated below).

Or, if your theme has a dedicated Custom CSS section (like Roam):
- Click Customize on your current theme.
- Click Theme settings (the gear icon on the left).

- Click Custom CSS.

- Paste this code into the box:
[data-product-gallery-figure="0"],
[data-product-gallery-thumbnail="0"] {
display: none !important;
}

- Click Save.

Ploqo even provided a more robust CSS snippet that addresses the potential issue of leaving the main image area empty, which JustinasR initially experienced:
[data-product-gallery-navigation-layout="featured"] {
position: relative !important;
}
[data-product-gallery-figure="0"] {
display: block !important;
position: absolute !important;
top: 0;
left: 0;
width: 100% !important;
opacity: 0 !important;
pointer-events: none !important;
}
[data-product-gallery-thumbnail="0"] {
display: none !important;
}
This code makes sure the space isn't left blank and the next image takes its rightful place without visual glitches. Always test these changes on a duplicate of your theme first!
Important consideration: As DitalTek and DiegoCosta2428 noted, using CSS only hides the image visually; it's still loaded in the HTML. This might not be ideal for page load speed if the image is very large and truly unnecessary.
Solution 3: Skipping with Liquid Code (Advanced)
For a cleaner, more performant solution, DiegoCosta2428 suggested modifying the theme's Liquid code. This involves telling Shopify's rendering engine to simply *not* output the first image in the product gallery loop.
The general idea is to add offset: 1 to the Liquid loop that iterates through your product images. This tells the loop to start from the second item. For example:
{% for media in product.media offset: 1 %}
{% endfor %}
This approach is more involved as it requires identifying the correct Liquid file and loop within your theme (often in sections like product-template.liquid or main-product.liquid, or within a snippet for the product gallery). It's best for those comfortable digging into theme files or for when you're working with a developer.
Wrapping It Up
As you can see, even a seemingly simple request like hiding a product image can have multiple solutions, each with its own pros and cons. The Shopify community is a fantastic resource for these kinds of challenges, offering practical advice and specific code snippets.
My advice? Always start with the simplest solution (reordering/deleting the image). If that doesn't meet your needs, move to custom CSS, keeping in mind its limitations and the need for theme-specific selectors. If performance or absolute cleanliness is paramount, then diving into Liquid code is the way to go. No matter which path you choose, remember to test your changes thoroughly on a duplicate theme to ensure everything looks and functions perfectly across all devices and pages.