[Resolved] How to Disable or Remove Woocommerce Categories displayed on Single Product Page

Home Forums Support [Resolved] How to Disable or Remove Woocommerce Categories displayed on Single Product Page

Home Forums Support How to Disable or Remove Woocommerce Categories displayed on Single Product Page

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1049010
    bluebit

    How can I disable, hide, or remove the categories being shown from the Single Product Page. I only want to show the tags.

    I tried this snippet, but it removed everything including the tags:

    /* Remove Categories from Single Products */
    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_meta’, 40 );

    #1049046
    Leo
    Staff
    Customer Support

    Hi there,

    Can you try the option in the customizer first?
    https://docs.generatepress.com/article/woocommerce-overview/#single-product

    Let me know πŸ™‚

    #1049059
    bluebit

    yes, i just tried it, but if I uncheck the option “display product meta data” it removes all the metadata, but I want to keep the tags meta data, only remove categories meta data

    #1049064
    Leo
    Staff
    Customer Support

    I see. Try this CSS:

    .product_meta .posted_in {
        display: none;
    }

    Adding CSS: https://docs.generatepress.com/article/adding-css/

    Let me know πŸ™‚

    #1049084
    bluebit

    that worked, but left some white space, how to reduce the white space above the tags?

    #1049088
    Leo
    Staff
    Customer Support

    Try this:

    .product_meta {
        padding-top: 10px;
    }

    Let me know πŸ™‚

    #1049105
    bluebit

    amazing it worked thanks

    #1049107
    Leo
    Staff
    Customer Support

    No problem πŸ™‚

    #1338348
    jasond

    do you have any filter so I can remove categories completely? It is for SEO purpose (not hiding by CSS display none)

    #1338531
    David
    Staff
    Customer Support

    Hi there,

    Woo doesn’t filter the Single Meta – you would need to make a copy of this template in your child theme:

    https://github.com/woocommerce/woocommerce/blob/7701d4b57cb20dc89e25bb7bf2ff872d85f4c535/templates/single-product/meta.php#L34

    And remove the line i highlighted.

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.