If you own an eCommerce business in 2023, chances are you’ve had some supply chain issues wreaking havoc on your inventory. Many Shopify owners have reported massive shortages and price hikes that are making it hard to keep popular products in stock. So what are Shopify store owners supposed to do with all those pages and URLs for products that are indefinitely out of stock?
Many shop owners think the answer is to archive or delete the old pages, but the sudden disappearance of a page or URL can have a massive negative impact on search engine rankings.
Remember, your product page may have been bookmarked, Pinned, shared on social media, cited, or linked by another website. We don't want to waste a drop of that link juice by hastily deleting a page when we've got plenty of other options.
Deleting OOS products causes 404 errors, penalties from Google, and frustration for your customers (don't delete!)
Rather than deleting products, which could bring down the wrath of the almighty Google, this guide will show you how to use Shopify tools, settings, and apps to handle out-of-stock SKUs and protect your website from the dreaded 404 error.
Option 1: Change the item quantity to zero [easy]
When a product goes out of stock, the first and most important thing to do is mark the available quantity to zero. When an item’s quantity is set to zero, most Shopify themes will automatically add a “Sold Out” badge to the front end of your page.
Note: If your Shopify theme doesn’t display the Sold Out badge, a Shopify Plus developer can help you customize your site’s badges and zero quantity behaviors
Option 2: Unlink the page from site navigation [easy]
Shopify’s Product Organization features—collections, categories, and tags—make it easier for users to find the right items on your site. Deleting the page’s Product Organization settings removes the page from your site’s navigation menus.
If your store has a constantly shifting inventory and lots of zero-quantity items, you might want to consider creating an archives collection that's used for outdated and out-of-stock listings.
Unlike your other collections, the archives collection should not be included in the primary site navigation. Instead, your archives collection should be hidden from site navigation and only used for zero quantity items that you don't want your customers to see.
When a product sells out, simply remove it from any active collections, and then add the item to your archives.
Option 3: Add a “flag” to the page title [easy]
One surefire way to let users know that a product is out of stock is to add a “flag” to the page title that lets users know the status of a particular item. The preferred way to flag a listing is with the addition of a separator like a bullet •, a pipe |, or an em-dash —, followed by OUT OF STOCK, SOLD OUT, or whatever works best for your brand.
The resulting page title will look something like this:
Baby Face Doll - Pink | OUT OF STOCK
By following the first 3 steps, we’ve protected our discontinued item page from appearing in on-site navigation menus and site search features. But removing our pages from the site navigation is only half the battle. Next we’ll outline ways to keep our discontinued pages out of search results, without harming search rankings.
Option 4: Hide out-of-stock products from your collections [intermediate]
If your Shopify or Shopify Plus store uses Collections to showcase products, there’s a simple setting that will hide zero-quantity products from active Collections. However, remember that hiding a product from Collections only works for shoppers on your site.
Note: Products hidden from Collections can still come up in Google searches, which we cover in Step 5 of this guide
*In order to hide out-of-stock products from your Shopify Collections, you must first enable inventory tracking in Shopify admin.
Enable inventory trackingNext, navigate to your conditions menu, and add the following automated conditions
For Products must match, select all conditions
For Inventory stock, select is greater than and enter 0
Click save
Now, when you change a product’s quantity to zero, it will automatically be hidden from Collections.
Option 5: Use the robots.txt file to disallow Google from crawling outdated pages [intermediate]
The robots.txt file is a simple text file found in the public_html folder of most websites. Search engine crawlers look to the robots.txt file for basic rules about which pages and sections of a website should (and shouldn’t) be crawled. Pages that can’t be crawled will not be shown in search results. By adding disallow command lines, we can control which pages will and won’t appear in search results.
The following is an example of a customized robots.txt file. Note the Allow and Disallow command lines. For any page that you want to exclude from search results, simply create a disallow command for that page using the syntax below:
User-agent: *