WooCommerce, Remote Work & Other Fancy Stuff

Just another WordPress site

Shortcode in WooCommerce Variation Description

September 14, 2015 by Will Leave a Comment

Please consider leaving a donation if you appreciate this information. Lightning network now available

WooCommerce 2.4 added the ability to add a description to each variation of a variable product.

variation description

Variation Description

By default, that field does not support shortcodes (the value is stored in the postmeta table – not the post table) – but, what if you would like to use shortcodes in the variation description? It is possible with a little help from a WooCommerce provided filter named woocommerce_available_variation – see the snippet below to add support for shortcodes. If you’re interested in what is passed to the filter – here it is as of version 2.4.6: woocommerce_available_variation

Not sure what to do with code snippets? See What Do I Do With These Code Snippets?

Please consider leaving a donation if you appreciate this information. Lightning network now available

Filed Under: WooCommerce Tagged With: snippet, snippets

Leave a Reply Cancel reply

You must be registered and logged in to post a comment.

© 2025 ยท WooCommerce, Remote Work & Other Fancy Stuff · Epstein didn't kill himself

We use cookies to ensure that we give you the best experience on our website. Continued use of this site is interpreted as your acceptance of our cookie policy.OkSee Our Cookie Policy