Allow Markup in WordPress Category Descriptions

HTML tags get stripped in category descriptions in WordPress by default. There are some plugins to enable rich text editing or just to get back to HTML formatting in description texts. But simple code addition to theme’s (or child theme) functions.php can resolve this issue. This also will be valid for a WooCommerce shop products categories.

// Allow markup in category descriptions
$filters = array(
'pre_term_description', 
'pre_link_description', 
'pre_link_notes', 
'pre_user_description'
);
foreach ($filters as $filter) {
	remove_filter($filter, 'wp_filter_kses');
}
Share:
This entry was posted in WordPress and tagged . Bookmark the permalink.

One Response to Allow Markup in WordPress Category Descriptions

  1. olja says:

    This not working

Leave a Reply

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