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 (7)
  • Integrations & Partnerships (15)
  • Rubik Combined Listings (10)
  • Rubik Variant Images Guides (100)
  • Rubik Variant Images Theme Compatibility (48)
  • 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
  • Shopify variant images FAQ with 30 questions
    Shopify variant images FAQ: 30 questions merchants actually ask
    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
  • 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 Wizard alternative: 5 Shopify apps to consider in 2026
App Comparison

Variant Image Wizard alternative: 5 Shopify apps to consider in 2026

April 26, 2026

Looking for a Variant Image Wizard alternative on Shopify? Five apps that handle multiple images per variant, with pricing, ratings, and the trade-offs that matter.

Rubik Variant Images on Underground Themes: Testament, Icon, Vantage & More (2026)
Rubik Variant Images Theme Compatibility

Rubik Variant Images on Underground Themes: Testament, Icon, Vantage & More (2026)

April 17, 2026

Underground is a Shopify theme studio from Tunbridge Wells, UK, behind 9 themes including Testament, Icon, Vantage, and Fashionopolism. Here is how Rubik Variant Images works on every Underground theme.

Rubik Variant Images on Shrine Themes: Variant Image Filtering for the No-App Theme (2026)
Rubik Variant Images Theme Compatibility

Rubik Variant Images on Shrine Themes: Variant Image Filtering for the No-App Theme (2026)

April 17, 2026

Shrine markets itself as the no-app theme but has no native variant image filtering. Here is how Rubik Variant Images fills that gap on Shrine Lite, Standard, and Pro.

Rubik Variant Images on Presidio Themes: Palo Alto, Broadcast & Modular (2026)
Rubik Variant Images Theme Compatibility

Rubik Variant Images on Presidio Themes: Palo Alto, Broadcast & Modular (2026)

April 17, 2026

Presidio Creative builds three popular Shopify themes. Here is how Rubik Variant Images handles variant image filtering and swatches on Palo Alto, Broadcast, and Modular.

  • 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.