This will definitely remove the word “category”. Add this code in functions.php.As you already know woocommerce_template_single_meta
is the hook responsible for meta information of the single-product.
File is present in /woocommerce/templates/single-product/meta.php
. Either you can use the following code to edit the HTML of meta.php or you can copy the file meta.php to themes/your-theme/woocommerce/single-product/meta.php
. Then edit the meta.php as you want it to be.
<?php
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta_remove_category', 40 );
function woocommerce_template_single_meta_remove_category(){
global $post, $product;
$cat_count = ( !empty( $cats ) && ! is_wp_error( $cats ) ) ?
count($cats) : 0;
$tag_count = ( !empty( $tags ) && ! is_wp_error( $tags ) ) ? count($tags) : 0;
?>
<div class="product_meta">
<?php do_action( 'woocommerce_product_meta_start' ); ?>
<?php if ( wc_product_sku_enabled() && ( $product->get_sku() || $product->is_type( 'variable' ) ) ) : ?>
<span class="sku_wrapper"><?php _e( 'SKU:', 'woocommerce' ); ?> <span class="sku" itemprop="sku"><?php echo ( $sku = $product->get_sku() ) ? $sku : __( 'N/A', 'woocommerce' ); ?></span>.</span>
<?php endif; ?>
<?php echo $product->get_categories( ', ', '<span class="posted_in">' . _n( '', '', $cat_count, 'woocommerce' ) . ' ', '.</span>' ); ?>
<?php echo $product->get_tags( ', ', '<span class="tagged_as">' . _n( 'Tag:', 'Tags:', $tag_count, 'woocommerce' ) . ' ', '.</span>' ); ?>
<?php do_action( 'woocommerce_product_meta_end' ); ?>
</div>
<?php
}