Shortcodes don’t work in product_cat descriptions

1 Comment

  1. Dave H.
    August 25, 2019 @ 9:38 am

    Where did you get this code from?

    They won’t do anything without creating functions – the add_filter function has 2 primary parameters:

    1. The filter to hook into and run code against

    2. The function to run – this function needs to exist in your codebase

    For example, you have add_filter(‘product_cat_description’, ‘do_shortcode’);

    This will do nothing since the do_shortcode function requires parameters. You’ll need to create another function to do what you’re looking for, pass that in, and then call do_shortcode with whatever parameters you’re trying to pass.


Leave a Reply

Your email address will not be published. Required fields are marked *


We publish performance optimisation guides regularly.

Subscribe so you never miss out.

We use cookies

We use cookies for various things on our site, including our on-site chat bubble (if you use it), our comment forms (if you use them) and for session handling (if you log in).

Other than that, we use cookies to identify where traffic came from to help us understand which traffic turns into sales, we use a cookie for Google Analytics traffic analysis and we use a cookie to customise adverts for our own products we think you'll be interested in.

You can read more detail in our privacy policy page. Please click 'Accept' or 'Decline' to continue.