If you want to show the “short description” field on the products that are on your homepage or in the loop, here’s the PHP code to add to your functions.php.
This code still works, unless you report otherwise. To exclude conflicts, temporarily switch to the Storefront theme, disable all plugins except WooCommerce, and test the snippet again: WooCommerce troubleshooting 101
Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza. Follow @rmelogli
43 thoughts on “WooCommerce: Show Product Description @ Shop Page”
Miki
Awesome post but it would be great to add how to limit the characters or words. I noticed you have a post for single product page but the Shop page would be great
This has worked great. Is it possible to truncate the text to show part of the short description with a “read more” toggle on the product shop loop? That would make this solution perfect!
Hi, i tried this code and many other codes but i m getting the same error. The product description is always coming above the product image in the shop page. Any solution?
Hi there,
I am new to wordpress so excuse me it I am asking stupid questions:
I inserted your code to my functions.php, but for some reason the description still doesn’t show up.
What I am aiming to do is to add the description to the products displayed on the startpage, for example using the block “product by category”.
Any clue what might be going wrong for me?
Thanks in Advance!
Not sure if this is block-friendly. Also, there might be a million reasons unfortunately. Keep trying, maybe with a different theme and no plugins but Woo, and let me know
Hi Marcial, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!
Hello Tania, thanks so much for your comment! Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. Thanks a lot for your understanding! ~R
Thank you! I kind of thought that as I haven’t been able to find how to do it anywhere. Thank you for contributing so much to helping understanding woocommerce, very much appreciated.
How can I show only the short description? This is showing long description if no short description is given for the product, when instead I want nothing to be shown if there is no short description.
I tried adding exact the same code snippet from above but my problem is, that the function is there but it’s not being displayed properly. So there is the text but it’s not visible. First I have to change the style (e.g. the font-size to 13px) in style.css to make it visible. Why is that? Is it normal that I have to edit also the style.css to make a custom action added to a hook visible?
Hey Martina, thanks for your comment! Yes, this probably depends on your custom theme – that’s why I added a class inside the HTML so that you can customize it as you wish 🙂
Hi Rodolfo,
I was trying to do something similar as your article.
What I would need to do is to add a short description for each product in the checkout page. I have done tons of research and this is the best I have come up with:
The issue is that with this code I can only display the number 1, but I can’t see my product decription or attributes…
Can you help me with that? I have tried everything I can…
Thank you
Paloma, thanks so much for your feedback! Yes, this is possible – but unfortunately this is custom work and I cannot provide this solution on the blog right now. If you would like to get a quote, feel free to go here. Thank you! R
Thank you for the article. Can you please help me with a problem. How I can remove short description from the Archive page for the variable product only?
Hi Redolfo,
Thanks so much for this! I’ve been searching for this solution and yours is the only one that is understandable to someone NOT too confident with coding! I’ve added the code and can now see the short description here: https://journey2health.co.za/index.php/shop/
I would like to make the description even shorter – perhaps only about 20 words. Any advice on how to do that would be GREATLY appreciated!
Thank you Charine, much appreciated 🙂 I see your website is broken so I can’t really help with the second question. However take a look at this article I wrote: Woocommerce: How to shorten product titles because that’s very similar to what you’re looking for! Hope this helps. R
hey ! may you help me please to display the excerpt from the second description of the woocommerce. here is the website . The excerpt should be about the 100.
Code from content-product.php
<a href="”>
$tab ) : $i++; ?>
<div id="content_tab_” >
the function that return me the product description is
. I can’t figure out how to substr it
Thanks for getting back to me. I appreciate your time and expertise.
I’m very new to web design as a hobby and fumbling through it.
The code below gives me the product short description in the cart.
What changes to this code will give me the long description in the cart?
(the_content)
Questions? Feedback? Customization? Leave your comment now! _____
If you are writing code, please wrap it like so: [php]code_here[/php]. Failure to complying with this, as well as going off topic or not using the English language will result in comment disapproval. You should expect a reply in about 2 weeks - this is a popular blog but I need to get paid work done first. Please consider joining the Business Bloomer Club to get quick WooCommerce support. Thank you!
Awesome post but it would be great to add how to limit the characters or words. I noticed you have a post for single product page but the Shop page would be great
Thank you Miki!
What about:
Hi Rodolfo, I don’t know if you are still active on this page.
The code is fine, but html tags, for example bold or simple , are not considered.
How can I do?
Not sure, what do the docs say?
This has worked great. Is it possible to truncate the text to show part of the short description with a “read more” toggle on the product shop loop? That would make this solution perfect!
Hey Michelle, yes, that’s doable. You could take a look here for inspiration: https://www.businessbloomer.com/woocommerce-truncate-short-description-with-read-more-toggle/
Worked great…how do we remove the link to the product from the text? is there a way to strip it of the href?
Hi Andy, you can change hook or hook priority (based on your theme) and put it after the closing link tag
Hi Rodolfo! How can i make this work for a certain category?
Sure! I suggest you take a look at “conditional logic”: https://businessbloomer.com/woocommerce-conditional-logic-ultimate-php-guide/. Enjoy 🙂
Hi, i tried this code and many other codes but i m getting the same error. The product description is always coming above the product image in the shop page. Any solution?
It really depends on your theme and custom CSS. Try changing “35” with a higher number, or check your custom CSS for “absolute” positioning or similar
What about adding short description for woocommerce product blocks?
Do they have some kind of hook like ‘woocommerce_after_shop_loop_item_title’ ?
No, it’s a little more complex in that case
Hi there,
I am new to wordpress so excuse me it I am asking stupid questions:
I inserted your code to my functions.php, but for some reason the description still doesn’t show up.
What I am aiming to do is to add the description to the products displayed on the startpage, for example using the block “product by category”.
Any clue what might be going wrong for me?
Thanks in Advance!
Not sure if this is block-friendly. Also, there might be a million reasons unfortunately. Keep trying, maybe with a different theme and no plugins but Woo, and let me know
Hi. Great work.
Is it possible to display the short description for all user roles except for just one specific? Thanks in advance.
Hi Marcial, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!
Is there a way to display the short description on mouse over shop image? Thank you.
Hello Tania, thanks so much for your comment! Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. Thanks a lot for your understanding! ~R
Thank you! I kind of thought that as I haven’t been able to find how to do it anywhere. Thank you for contributing so much to helping understanding woocommerce, very much appreciated.
Brilliant 🙂
How can I show only the short description? This is showing long description if no short description is given for the product, when instead I want nothing to be shown if there is no short description.
Thanks!
Hey Joe, thanks for your comment! “the_excerpt” should only echo the short description – is that the one you’re using?
Hello Rodolfo,
I tried adding exact the same code snippet from above but my problem is, that the function is there but it’s not being displayed properly. So there is the text but it’s not visible. First I have to change the style (e.g. the font-size to 13px) in style.css to make it visible. Why is that? Is it normal that I have to edit also the style.css to make a custom action added to a hook visible?
Thanks in advance!
Hey Martina, thanks for your comment! Yes, this probably depends on your custom theme – that’s why I added a class inside the HTML so that you can customize it as you wish 🙂
Try to replace the body of the function with:
and declare the class style as you wish.
Hi Rodolfo,
I was trying to do something similar as your article.
What I would need to do is to add a short description for each product in the checkout page. I have done tons of research and this is the best I have come up with:
$post_data->post_excerpt );
return $other_data;
}
?>
The issue is that with this code I can only display the number 1, but I can’t see my product decription or attributes…
Can you help me with that? I have tried everything I can…
Thank you
Paloma, thanks so much for your feedback! Yes, this is possible – but unfortunately this is custom work and I cannot provide this solution on the blog right now. If you would like to get a quote, feel free to go here. Thank you! R
Thank you for the article. Can you please help me with a problem. How I can remove short description from the Archive page for the variable product only?
Hi Sourav, you can simply wrap the function contents within this conditional check:
function …. {
if( $product->is_type( ‘simple’ ) ){
// function content
}
}
Thank you….
You’re welcome Vivek!
Hi Redolfo,
Thanks so much for this! I’ve been searching for this solution and yours is the only one that is understandable to someone NOT too confident with coding! I’ve added the code and can now see the short description here: https://journey2health.co.za/index.php/shop/
I would like to make the description even shorter – perhaps only about 20 words. Any advice on how to do that would be GREATLY appreciated!
Thank you Charine, much appreciated 🙂 I see your website is broken so I can’t really help with the second question. However take a look at this article I wrote: Woocommerce: How to shorten product titles because that’s very similar to what you’re looking for! Hope this helps. R
hello I’m Not able to get the content of the product .
I am using “storefront ” Theme i.e woocomerce free theme.
On home page I want to show Read more button with description.
Thanks
here is the question
Hi Eliza, what do you exactly mean with “excerpt from the second description”? Is that the long description?
hey ! may you help me please to display the excerpt from the second description of the woocommerce. here is the website . The excerpt should be about the 100.
Code from content-product.php
<a href="”>
$tab ) : $i++; ?>
<div id="content_tab_” >
the function that return me the product description is
. I can’t figure out how to substr it
Hi Rodolfo,
Thank you again for the tip.
$post->post_content didn’t work for me but $post_data->post_content did.
I really appreciate your expertise and time. It helped me to get it working and understand a bit more. How exciting!
Regards
Awesome 🙂
Hi Rodolfo,
Thanks for getting back to me. I appreciate your time and expertise.
I’m very new to web design as a hobby and fumbling through it.
The code below gives me the product short description in the cart.
What changes to this code will give me the long description in the cart?
(the_content)
add_filter( ‘woocommerce_get_item_data’, ‘wc_checkout_description_so_27900033’, 10, 2 );
function wc_checkout_description_so_27900033( $other_data, $cart_item )
{
$post_data = get_post( $cart_item[‘product_id’] );
$other_data[] = array( ‘name’ => ‘description’, ‘value’ => $post_data->post_excerpt );
return $other_data;
}
thanks
Try use $post->post_content instead of $post_data->post_excerpt 🙂