skip to Main Content

See the image for how it is getting
My installed plugins in WP

I wanted to remove the "span" element from the add to cart product title. I provided the both images one with problem and the other are my installed plugins.
I think its in the Boostify Header Footer Builder(The client says that).

2

Answers


  1. To remove HTML tags from product names in cart and in checkout, you can use the following:

    add_filter('woocommerce_cart_item_name', 'strip_html_tags_from_cart_item_name', 9000, 1 );
    function strip_html_tags_from_cart_item_name( $product_name ) {
        $product_name = wp_strip_all_tags( $product_name, true );
    
        return $product_name;
    }
    

    Code goes in functions.php file of your active child theme (or active theme). Tested and works.

    Login or Signup to reply.
  2. Great post, I have the same issue only in the thank you page
    with the product overview > product title, do you have any suggestions on how to target that?

    Kind regards.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search