Hide Woocommerce category description

Hi I have used a hook to add the product description x_after_site_begin which is working correctly. But unsure of what hook I should be calling to remove the existing description in the content area. I tried the below but reading because I am using Integrity stack it may be added by Pro theme custom hook which I cannot find what this is to remove that action instead. If you could supply it thanks as prefer that than using css.

remove_action( 'woocommerce_archive_description', 'woocommerce_product_archive_description', 10 );

Hello Quentin,

Thanks for writing in!

To resolve your issue, please update your PHP code and use this instead:

function remove_woo_elements(){
  // Remove the product description
  remove_action( 'woocommerce_archive_description', 'woocommerce_product_archive_description', 10 );
}
add_action('wp', 'remove_woo_elements');

We would loved to know if this has work for you. Thank you.

This seems to still be displaying for now I have hidden it via css but would be good to work out why.

Other hooks I have used for removing from parts such as meta and adding in a different area seem to be working fine just this one hook reason I thought maybe you have a custom terms description hook for displaying this.

Are you referring to the archive subtitle / description like in the screenshot below?

If so, you’ll need to override _landmark-header.php which is located in pro\framework\legacy\cranium\headers\views\integrity. In case you don’t know how to override templates in Pro yet, please see our theme customization guide at https://theme.co/apex/forum/t/customizations-best-practices/205

Find these lines of code:

<?php elseif ( x_is_product_category() ) : ?>
<?php elseif ( x_is_product_tag() ) : ?>

Below each of those lines, you’ll see this block of code:

  <header class="x-header-landmark x-container max width">
    <h1 class="h-landmark"><span><?php echo $title; ?></span></h1>
    <p class="p-landmark-sub"><span><?php echo $subtitle; ?></span></p>
  </header>

Remove all of that code or parts of it. Please note that this requires web developer knowledge. If you’re not familiar with web development, you need to enlist help from a third party developer.

If that is not the area you want to modify, please provide us the URL of the page and a screenshot of the area so we could provide the specific correct solution and avoid guess work.

Thanks.

Above is an image of the term description for a product category that isn’t being hidden by the previous hook provided included inspector. I am fine with copying and editing a template file if this is controlled removing by hook isn’t possible.

Hello Quentin,

By default, that description is not present. You may have added a custom code in your child theme’s functions.php file. ​To assist you better with this issue, would you mind providing us the url of your site with login credentials so we can take a closer look at your site and codes?

To do this, you can create a secure note with the following info:
– Link to your site
– WordPress Admin username / password

To know how to create a secure note, please check this out: https://theme.co/apex/forum/t/how-to-get-support/288

Thank you.

We added custom code to insert the description and subtitle above this. But the description we are wanting to remove is the description that was there initially. Added secure note with details.

Hello Quentin,

I have logged in and updated the code into this:

function remove_woo_elements(){
  // Remove the product description
  remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 );
}
add_action('wp_head', 'remove_woo_elements');

The description no longer loads now. Please check the site again.

2 Likes

Great thanks this topic can now be closed.

You are most welcome!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.