If you use WooCommerce and want to hide the description of the variations only on your site, but keep them in the Facebook catalog, here’s a quick solution!
🔧 Step-by-step:
- Go to the WordPress dashboard.
- Go to appearance > Theme Editor (preferencialmente no tema filho).
- Open the file
functions.php
e cole o código abaixo:
add_filter('woocommerce_product_variation_get_description', 'esconder_descricao_variacao_no_site', 10, 2);
function esconder_descricao_variacao_no_site($descricao, $produto) {
if (is_product()) {
return ''; // Esconde a descrição da variação apenas na página do produto
}
return $descricao;
}
What the code does:
Hides the description of variations only on the product pages of your site. In the Facebook or Google Merchant Center data feed, the description is still available.
Simple, quick and easy.
See you next time!