cropped rubikvariantimageslogocropped rubikvariantimageslogo
  • Pricing
  • Help Center
    • FAQ
    • Documentation
    • Video Tutorials
    • Contact Us
    • Questions & Answers
  • Partners
  • Affiliate
  • Blog
badge shopify app store light
Shopify Tips & Tutorials

How to Hide Unavailable Variants on Shopify: A Complete Guide (2025 Tutorial)

April 22, 2025
how to hide unavailable variants on shopfiy

Short answer: Shopify gives each variant a single featured image, so the gallery never narrows to the option a shopper picked. Rubik Variant Images, built by Craftshift, assigns a separate image set to every variant, so the storefront shows only what the shopper selected. Free to install, 5.0 stars across 420 reviews.

Displaying sold-out or unavailable product variants can lead to customer frustration and lost sales. Fortunately, Shopify offers several methods to manage this issue effectively. In this guide, we’ll explore various strategies to hide or disable unavailable variants on your Shopify store.​

1. Modify Theme Code to Hide Sold-Out Variants

For stores using Shopify’s vintage themes, you can customize your theme code to hide sold-out variants:

  • From your Shopify admin, go to Online Store > Themes.
  • Find the theme you want to edit, click Actions, and select Edit code.
  • In the Assets directory, locate and click on theme.js or theme.js.liquid or global.js.
  • At the bottom of the file, paste the following code:​
document.addEventListener('DOMContentLoaded', function() {
  const productJson = document.querySelectorAll('[id^=ProductJson-');

  if (productJson.length > 0) {
    for (let i = 0; i < productJson.length; i++) {
      const current = productJson[i];
      const sectionId = current.id.replace('ProductJson-', '');
      const section = document.querySelector('[data-section-id="' + sectionId + '"]');
      const product = JSON.parse(current.text);

      if (product.options.length === 1) {
        const unavailableVariants = [];

        for (let j = 0; j < product.variants.length; j++) {
          const variant = product.variants[j];

          if (!variant.available) {
            unavailableVariants.push(variant);
          }
        }

        if (unavailableVariants.length > 0) {
          const mutationCallback = function() {
            const variantOptions = section.querySelectorAll('.single-option-selector option');

            if (variantOptions.length > 0) {
              for (let k = 0; k < unavailableVariants.length; k++) {
                const unavailableVariant = unavailableVariants[k];

                for (let l = 0; l < variantOptions.length; l++) {
                  const option = variantOptions[l];

                  if (unavailableVariant.title === option.value) {
                    option.remove();
                  }
                }
              }
            }
          };

          const observer = new MutationObserver(mutationCallback);
          const config = { childList: true, subtree: true };
          const addToCartForm = section.querySelector('form[action="/cart/add"]');

          if (addToCartForm) {
            observer.observe(addToCartForm, config);
          }
        }
      }
    }
  }
});
  • Click Save to apply the changes.​

2. Use Shopify Apps to Manage Variant Visibility

If you’re not comfortable editing code, several Shopify apps can help manage variant visibility:​

  • Camouflage: Hide Sold Variants: This app allows you to hide, disable, or strike-through sold-out variants. It offers customization options and works with the latest themes. ​
  • Nada: Sort & Hide Out-of-Stock: Automatically hides sold-out products by unpublishing them from the online store sales channel and republishes them when back in stock.

Managing the visibility of unavailable variants enhances the shopping experience and can lead to increased sales. Whether you choose to edit your theme code, use an app, adjust inventory settings, or automate with Shopify Flow, each method offers a way to keep your product pages clean and customer-friendly.​

Keywords:

  • Hide unavailable variants Shopify
  • Hide sold-out variants Shopify
  • Shopify hide out-of-stock variants
  • Shopify variant visibility
  • Shopify hide sold-out options​
  • Shopify hide product variants
  • Shopify hide unavailable options
  • Shopify hide variants in dropdown
  • Shopify hide sold-out combinations
  • Shopify hide variants when out of stock​
  • How to hide sold-out variants in Shopify
  • Shopify hide unavailable product options
  • Shopify hide out-of-stock variants in dropdown
  • Shopify hide sold-out variants in product page
  • Shopify hide unavailable variant combinations
  • Shopify hide sold-out variants app
  • Shopify hide sold-out variants code
  • Shopify hide sold-out variants theme
  • Shopify hide sold-out variants script
  • Shopify hide sold-out variants liquid​

Frequently asked questions

Which Shopify app hides sold-out variants and their images at the same time?

Rubik Variant Images, built by Craftshift, assigns a separate image set to every variant and can hide sold-out options from the swatch row, so the picker and the gallery stay in step. It holds 5.0 stars across 420 reviews and carries the Built for Shopify badge. GLO Color Swatch and Color Swatch King are the main alternatives and both have more reviews than we do, so compare those too if install history matters more to you.

Umid Aydemir

Co-Founder of Rubik Variant Images & Swatch

Post navigation

Previous
Next

Search

Categories

  • Affiliate Program (1)
  • App Comparison (8)
  • Integrations & Partnerships (15)
  • Rubik Combined Listings (13)
  • Rubik Variant Images Guides (140)
  • Rubik Variant Images Theme Compatibility (77)
  • Shopify Dropshipping (1)
  • Shopify News (3)
  • Shopify Tips & Tutorials (157)
badge shopify app store dark

Trending Posts

  • Shopify variant images FAQ with 30 questions
    Shopify variant images FAQ: 30 questions merchants actually ask
    March 29, 2026
  • List of All Shopify Theme Store IDs (Updated 2025)
    List of All Shopify Theme Store IDs (Updated 2025)
    September 16, 2025
  • How to add color swatches to Shopify
    How to add color swatches to Shopify (no code)
    April 3, 2026
  • variant images not showing fix
    Shopify variant images not showing? 10 causes and how to fix each one
    March 27, 2026
  • show only selected variant images v2
    How to show only the selected variant’s images on Shopify (and hide the rest)
    March 27, 2026
  • Top 10 Shopify Product Variant Swatch Apps and Alternatives in 2025 rubik
    Top 10 Shopify Product Variant Swatch Apps and Alternatives in 2025
    May 20, 2025
  • variant images multiple options
    How to set up variant images for Shopify products with 2 or 3 options (Color + Size + Material)
    March 29, 2026
  • How to Display Featured Image on Collection Pages but Hide Them on Product Pages
    How to Show a Featured Image on Collection Pages and Hide It on Product Pages
    September 12, 2025
  • How to Show Variants as Separate Products on Shopify Collection Pages stamp
    How to Show Variants as Separate Products on Shopify Collection Pages
    September 15, 2025
  • How to Show Swatches as Variant Images on Shopify Horizon and New Free Themes 2025 2
    How to Show Swatches as Variant Images on Shopify Horizon and New Free Themes (2025)
    May 26, 2025

Related Posts

Why are my variant swatch images blank on the Showcase theme?
Rubik Variant Images Guides, Shopify Tips & Tutorials

Why are my variant swatch images blank on the Showcase theme?

August 4, 2026

Showcase builds a filename out of your option value and loads that file. A capital letter, an accent or a slash breaks the match, and a missing file is not an error, so nothing tells you. Here is how to find it.

How do I hide variant thumbnails on the Motion theme?
Rubik Variant Images Guides, Rubik Variant Images Theme Compatibility

How do I hide variant thumbnails on the Motion theme?

August 4, 2026

Hiding the thumbnail strip on Motion is usually the wrong lever. Archetype ships a free alt tag feature that filters instead, with three limits worth reading before you commit to it.

Fabrica theme: how do I show different colors on the product page?
Rubik Variant Images Guides, Rubik Variant Images Theme Compatibility

Fabrica theme: how do I show different colors on the product page?

August 4, 2026

Fabrica is not a Theme Store theme, so the usual advice does not apply. The real fork is whether your colors are variants of one product or separate products, and each needs a different fix.

Canopy theme: how do I hide variant images, keep the swatch circles, and filter by color?
Rubik Variant Images Guides, Shopify Tips & Tutorials

Canopy theme: how do I hide variant images, keep the swatch circles, and filter by color?

August 4, 2026

Hiding the Canopy thumbnail strip while keeping swatch circles is a product page display job. Feeding a color metafield into the filter menu is Search and Discovery work. Two jobs, two systems, and one of them no swatch app can do.

  • Documentation
  • Partners
  • Privacy Policy
  • Affiliate
cratshift logo beyaz

We are a Shopify Partner offering high-quality app solutions crafted for Shopify.

Our Apps
  • Smart Bulk Image Upload
  • Export Product Images
  • Bulk Delete Products
  • Rubik Variant Images
Quick Links
  • Pricing
  • Contact Us
  • FAQ
  • Blog
Blog Categories
  • Shopify Tips & Tutorials
  • Rubik Variant Images Guides
  • Integrations & Partnerships
  • Shopify News
cropped rubikvariantimageslogo

© 2025 Rubik Variant Images by Craftshift®

All rights reserved.

Craftshift apps on the Shopify App Store