🚀 Is building a website too difficult? Let me guide you step by step—Learn about the 「Naibabiji WordPress Website Building Coaching Service」 →

Allow inserting HTML code and images in WooCommerce category descriptions

WooCommerce product categories can have category descriptions. Some Themes will display these descriptions on the Frontend. ManyForeign Trade Independent Websitesuse category descriptions for page SEO optimization. However, by default, WooCommerce category descriptions only support plain text; HTML and images cannot be used. We can use the following code to enable HTML support in WooCommerce category descriptions.
/** * Allow HTML in term (category, tag) descriptions */ foreach ( array( 'pre_term_description' ) as $filter ) { remove_filter( $filter, 'wp_filter_kses' ); if ( ! current_user_can( 'unfiltered_html' ) ) { add_filter( $filter, 'wp_filter_post_kses' ); } } foreach ( array( 'term_description' ) as $filter ) { remove_filter( $filter, 'wp_kses_data' ); }
Source:https://woocommerce.com/document/allow-html-in-term-category-tag-descriptions/There's also another Plugin that hasn't been tested; those interested can give it a try:Allow HTML in Category Descriptions 分类添加html权限After this, you can insert images in category descriptions using HTML code.

🚀 Still feeling confused after reading the tutorial? Let me guide you step-by-step instead.

「Naibabiji WordPress Website Building Coaching」 — From selecting a domain and purchasing hosting to installing themes and publishing posts, I「ll guide you through every step, helping you avoid detours and reach your goals directly.

👉 Learn about Website Building Coaching Service
🔒

Comments are closed

The comment function for this article is closed. If you have any questions, please feel free to contact us through other channels.

×
二维码

Scan to Follow