# Short Description Under Product Titles in the Shop

> Shows a trimmed version of each product's short description below its title on shop and category pages.

- Type: PHP
- Runs: Run everywhere
- Category: [WooCommerce](https://wpide.com/library/category/woocommerce/)
- Requires: WooCommerce
- Tags: woocommerce, shop, description
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/woo-short-description-in-loop/

## Code

```php
add_action( 'woocommerce_after_shop_loop_item_title', function () {
    global $product;

    $words = 15; // Maximum number of words.

    if ( ! $product instanceof WC_Product ) {
        return;
    }

    $text = $product->get_short_description();

    if ( '' === trim( $text ) ) {
        return;
    }

    echo '<p class="wpide-loop-excerpt" style="font-size:.9em;margin:.4em 0;">' . esc_html( wp_trim_words( wp_strip_all_tags( $text ), $words ) ) . '</p>';
}, 4 );
```

## Notes

Change $words to set how many words are shown.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Short Description Under Product Titles in the Shop" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
