How can I hide specific products from internal and Google searches?

I I’m looking to apply a metadata rule that will hide all the products that have the quantity <= 1 from the internal search and prevent them from appearing on google searches.

I’ve added some code that has filtered them out of the internal search but when typing the product in it still appears (before pressing enter) and also in google search.

How can I prevent these products from appearing?

Thanks

Hello there

To hide all products that have a quantity of 1 or less from internal search and prevent them from appearing in Google search results, you can add a metadata rule

  1. Click on “SEO” to access the SEO settings.

  2. In the “Metadata” tab, click “New Metadata” to create a new metadata rule.

  3. Give the metadata rule a name, such as “Hide Products with Quantity 1 or Less”.

  4. In the “Target” field, select “Product” to apply the rule to all product entries.

  5. In the “Condition” field, select “Quantity” and set the value to “1” or less.

  6. In the “Action” field, select “Noindex” to prevent the product from appearing in Google search results.

  7. Save the metadata rule.

  8. Go to the product entry for each product that has a quantity of 1 or less and add the metadata rule to the entry.

  9. Save the product entry.