Skip to content

Can I prevent Google indexing in stock/out of stock status?

We’ve recently updated to Magento 2.4.3, I’m not sure if this issue is due to this version or if it existed previously. It’s not been a problem until now.

We use an extension to set a custom stock status for each product and display this on product list and product detail pages. To allow customers to backorder out of stock items we set ALL products to be ‘in stock’ in Magento inventory and control the frontend status message with the custom stock status extension.

The problem is that Google organic search appears to be showing Magento inventory status in rich data. I can turn this off but then none of our products which are actually in stock would be shown as ‘in stock’ in rich data.

Is there some way we can only show product status in rich data for products which genuinely are in stock (i.e +ve inventory) and not show product status for out of stock (0 or -ve inventory)?
Thanks