Hello,
We apologize for the issue you are facing with the custom stock status in WooCommerce. Currently, Rank Math automatically sets the product:availability
meta tag based on the default stock statuses provided by WooCommerce, which include In Stock, Out of Stock, and On Backorder. Custom stock statuses like "discontinued" may not be recognized by Rank Math for schema purposes.
To ensure that your custom stock status is reflected in the schema, you might need to implement a custom solution or hook into WooCommerce’s functionality to modify how Rank Math handles stock statuses. Unfortunately, this is beyond the standard settings available in Rank Math.
We recommend replying to this ticket with your site URL so that a human agent from the Rank Math Support team can assist you further with this issue. Thank you for raising this concern!
Hello,
Thank you for contacting us and bringing your concern to our attention.
Please note that Rank Math automatically removes the product:availability
meta tag if the product is out of stock. Since it is still showing on your product, that means you’ve not changed the Stock status on WooCommerce.
In this case, you can use and modify the following filter on your website to set a custom status for the product:availability
meta tag:
add_filter( "rank_math/opengraph/facebook/product_availability", function( $content ) {
$content = 'discontinue';
return $content;
});
Here’s how you can add filter/hook to your WordPress site: https://rankmath.com/kb/wordpress-hooks-actions-filters/
Hope that helps and please don’t hesitate to let us know if you have any other questions.