Hi @musojo
I’ll be glad to assist you with this! I have replicated this on my end, and I was able to hide the SKU, Category, and Tags, as shown in this image.
I’ve put this code in functions.php:
/**
* Hide SKU, Cats, Tags @ Single Product Page - WooCommerce
*/
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );
If you meant to only hide tags, and keep the category and SKU, you may need to add the following codes (but do not remove the code above, which you’ve added initially to remove them):
Show SKU again:
/**
* Show SKU Again @ Single Product Page - WooCommerce
*/
add_action( 'woocommerce_single_product_summary', 'njengah_show_sku_again_single_product', 40 );
function njengah_show_sku_again_single_product() {
global $product;
?>
<div class="product_meta">
<?php if ( wc_product_sku_enabled() && ( $product->get_sku() || $product->is_type( 'variable' ) ) ) : ?>
<span class="sku_wrapper"><?php esc_html_e( 'SKU:', 'woocommerce' ); ?> <span class="sku"><?php echo ( $sku = $product->get_sku() ) ? $sku : esc_html__( 'N/A', 'woocommerce' ); ?></span></span>
<?php endif; ?>
</div>
<?php
Show Category again:
/**
* Show Categories Again @ Single Product Page - WooCommerce
*/
add_action( 'woocommerce_single_product_summary', 'njengah_show_cats_again_single_product', 40 );
function njengah_show_cats_again_single_product() {
global $product;
?>
<div class="product_meta">
<?php echo wc_get_product_category_list( $product->get_id(), ', ', '<span class="posted_in">' . _n( 'Category:', 'Categories:', count( $product->get_category_ids() ), 'woocommerce' ) . ' ', '</span>' ); ?>
</div>
<?php
}
In case it’s still not working, please copy all the codes inside your functions.php and paste it here for us to identify which causes the issue.
Cheers!