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

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​
Umid Aydemir

Co-Founder of Rubik Variant Images & Swatch

Post navigation

Previous
Next

Search

Categories

  • Affiliate Program (1)
  • App Comparison (6)
  • Integrations & Partnerships (15)
  • Rubik Combined Listings (10)
  • Rubik Variant Images Guides (100)
  • Rubik Variant Images Theme Compatibility (34)
  • Shopify Dropshipping (1)
  • Shopify News (3)
  • Shopify Tips & Tutorials (148)
badge shopify app store dark

Trending Posts

  • List of All Shopify Theme Store IDs (Updated 2025)
    List of All Shopify Theme Store IDs (Updated 2025)
    September 16, 2025
  • 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
  • Shopify variant images FAQ with 30 questions
    Shopify variant images FAQ: 30 questions merchants actually ask
    March 29, 2026
  • 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
  • Activate Variant Image Swatches in All New Shopify Free Themes Horizon Themes Without Code or App
    Activate Variant Image Swatches in All New Shopify Free Themes (Horizon Themes) – Without Code or App
    June 9, 2025
  • image 5
    How to Display Multiple Variant Images with Rubik Variant Images on Instant Page Builder ?
    April 9, 2025
  • Rubik Variant Images
    Shopify Multiple Variant Images – How to Display Images Specific to the Selected Variant?
    March 3, 2025
  • how to find theme store id shopify
    How to Find Your Theme’s Shopify Theme Store ID (2025 Guide)
    April 21, 2025
  • 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
  • Overcoming Shopify’s 100 Variant & 250 Image Limit (2025 Guide) white
    Overcoming Shopify’s 100 Variant & 250 Image Limit (2025 Guide)
    September 18, 2025

Related Posts

variant image thumbnails with delete icons
Rubik Variant Images Guides

Shopify bulk delete variant images: the cleanup workflow

April 9, 2026

Unused variant images bloat product galleries, slow admin load, and eat into the 250 media per product cap. Here is how to bulk delete them without breaking live variants.

a page builder canvas with image to layout transformation
Rubik Variant Images Guides

GemPages image to layout: how the feature works with variant images

April 9, 2026

GemPages has a quiet feature called image to layout that turns any image into an editable layout. Here is how it works, when to use it, and how it plays with variant images.

a price tag showing zero with product image cards
Rubik Variant Images Guides

Best free Shopify variant image apps (2026)

April 9, 2026

Which Shopify variant image apps actually have usable free plans in 2026? Rubik first, the rest honest about their limits.

round color swatches in a row with a star
Rubik Variant Images Guides

Best Shopify color swatch apps (2026)

April 9, 2026

Every real Shopify color swatch app compared honestly in 2026. Rubik first, the rest ranked by what they actually 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.