🚀 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 call and display the category description content on the frontend. ManyForeign Trade Independent Websitesuse category descriptions for page SEO optimization. However, by default, WooCommerce category descriptions only support plain text; HTML cannot be used, and images cannot be inserted. 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 is also another plugin that hasn't been tested; interested users can try it:Allow HTML in Category Descriptions 分类添加html权限Afterwards, you can insert images in category descriptions using HTML code.

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

「Naibabiji WordPress Website Building Coaching Service」—From choosing a domain and buying hosting, to installing a Theme and publishing content, I「ll coach you through every step, helping you avoid detours and reach your goal directly.

👉 Learn about the 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 QR Code to Follow

AI Website Building Assistant

🤖
Hello! I am the Naibabiji AI Assistant. How can I help you?
Quick Consultation: