{"id":19520,"date":"2011-06-15T23:53:46","date_gmt":"2011-06-15T18:23:46","guid":{"rendered":"https:\/\/www.quickonlinetips.com\/archives\/?p=19520"},"modified":"2026-10-13T13:39:51","modified_gmt":"2026-10-13T08:09:51","slug":"html-scripts-in-wordpress-category-descriptions","status":"publish","type":"post","link":"https:\/\/www.quickonlinetips.com\/archives\/2011\/06\/html-scripts-in-wordpress-category-descriptions\/","title":{"rendered":"How to Add HTML and Scripts in WordPress Category Descriptions (2026)"},"content":{"rendered":"<p>Can you add HTML and scripts to WordPress category descriptions? Category and tag pages can rank well in Google, but only if they offer more than a list of posts. A good intro with links, an image or a short guide turns a thin archive into a useful landing page. Here is how to add HTML to <strong>WordPress category descriptions<\/strong> in 2026, safely, and how to show it in your theme.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-large wp-image-64034\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/html-wordpress-category-descriptions-1024x538.webp\" alt=\"Add HTML in WordPress category descriptions\" width=\"1024\" height=\"538\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/html-wordpress-category-descriptions-1024x538.webp 1024w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/html-wordpress-category-descriptions-300x158.webp 300w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/html-wordpress-category-descriptions-150x79.webp 150w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/html-wordpress-category-descriptions-768x403.webp 768w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/html-wordpress-category-descriptions.webp 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p><strong>Quick answer:<\/strong> On a normal single-site WordPress install, administrators can already use HTML such as links, bold text, lists and images in category and tag descriptions under Posts &gt; Categories &gt; Edit. Users without the &#8220;unfiltered_html&#8221; capability, such as editors on multisite, have tags stripped; a small code snippet can allow more HTML. Your theme must call <code>the_archive_description()<\/code> (or the Term Description block) to display it.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_90 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6b00000f96bbc\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #1a202c;color:#1a202c\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #1a202c;color:#1a202c\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6b00000f96bbc\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/06\/html-scripts-in-wordpress-category-descriptions\/#Why_add_HTML_to_category_descriptions\" >Why add HTML to category descriptions?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/06\/html-scripts-in-wordpress-category-descriptions\/#How_to_add_HTML_to_a_category_description\" >How to add HTML to a category description<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/06\/html-scripts-in-wordpress-category-descriptions\/#If_your_HTML_is_stripped\" >If your HTML is stripped<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/06\/html-scripts-in-wordpress-category-descriptions\/#How_to_display_the_description_in_your_theme\" >How to display the description in your theme<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/06\/html-scripts-in-wordpress-category-descriptions\/#Category_page_SEO_tips\" >Category page SEO tips<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/06\/html-scripts-in-wordpress-category-descriptions\/#FAQ\" >FAQ<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/06\/html-scripts-in-wordpress-category-descriptions\/#Can_I_add_images_to_a_category_description\" >Can I add images to a category description?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/06\/html-scripts-in-wordpress-category-descriptions\/#Is_it_safe_to_allow_scripts_in_category_descriptions\" >Is it safe to allow scripts in category descriptions?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/06\/html-scripts-in-wordpress-category-descriptions\/#Why_is_my_category_description_not_showing\" >Why is my category description not showing?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Why_add_HTML_to_category_descriptions\"><\/span>Why add HTML to category descriptions?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li>Write a helpful introduction for each topic.<\/li>\n<li>Link to your best &#8220;start here&#8221; posts in that category.<\/li>\n<li>Add a featured image or comparison table.<\/li>\n<li>Give search engines more context, so category pages can rank for broad topics.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"How_to_add_HTML_to_a_category_description\"><\/span>How to add HTML to a category description<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ol>\n<li>Go to <strong>Posts &gt; Categories<\/strong> (or Tags) and click <strong>Edit<\/strong> under the category.<\/li>\n<li>In the <strong>Description<\/strong> box, type your text with HTML, for example:<\/li>\n<\/ol>\n<pre><code>&lt;p&gt;Our &lt;strong&gt;WordPress tutorials&lt;\/strong&gt; help you build a faster site.&lt;\/p&gt;\n&lt;ul&gt;\n  &lt;li&gt;&lt;a href=\"\/archives\/wordpress-speed\/\"&gt;Speed up WordPress&lt;\/a&gt;&lt;\/li&gt;\n  &lt;li&gt;&lt;a href=\"\/archives\/wordpress-security\/\"&gt;WordPress security&lt;\/a&gt;&lt;\/li&gt;\n&lt;\/ul&gt;<\/code><\/pre>\n<ol start=\"3\">\n<li>Click <strong>Update<\/strong> and view the category page.<\/li>\n<\/ol>\n<p>Some SEO plugins, including Rank Math and Yoast, replace the plain box with a visual editor, which makes formatting easier.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"If_your_HTML_is_stripped\"><\/span>If your HTML is stripped<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>WordPress removes HTML from descriptions for users who lack the <code>unfiltered_html<\/code> capability (for example editors on multisite, or sites where <code>DISALLOW_UNFILTERED_HTML<\/code> is set). To allow safe HTML for all users who can edit terms, add this to a small custom plugin or your child theme&#8217;s functions.php:<\/p>\n<pre><code>foreach ( array( 'pre_term_description' ) as $filter ) {\n    remove_filter( $filter, 'wp_filter_kses' );\n    add_filter( $filter, 'wp_kses_post' );\n}<\/code><\/pre>\n<p>This allows the same safe HTML as post content (links, images, lists) but still blocks scripts. Only allow full scripts if every editor is fully trusted.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_display_the_description_in_your_theme\"><\/span>How to display the description in your theme<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li><strong>Classic themes:<\/strong> add <code>&lt;?php the_archive_description( '&lt;div class=\"taxonomy-description\"&gt;', '&lt;\/div&gt;' ); ?&gt;<\/code> to archive.php or category.php.<\/li>\n<li><strong>Block themes:<\/strong> edit the Archive or Category template in the Site Editor and add the <strong>Term Description<\/strong> block.<\/li>\n<li>Most modern themes, including Kadence and Astra, already show it under the archive title.<\/li>\n<\/ul>\n<p>Style it with a little CSS; here is how to <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2020\/02\/add-custom-css-wordpress-post-editor\/\">add custom CSS in WordPress<\/a>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Category_page_SEO_tips\"><\/span>Category page SEO tips<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li>Keep category descriptions original, 100 to 300 words, and useful.<\/li>\n<li>Do not create many overlapping categories. Here is how to <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2020\/03\/convert-category-to-tags-wordpress\/\">convert categories to tags<\/a> when needed.<\/li>\n<li>Noindex paginated archive pages if they add no value; see how to <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2020\/04\/noindex-archive-subpages-yoast-seo-plugin\/\">noindex archive subpages<\/a>.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"FAQ\"><\/span>FAQ<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Can_I_add_images_to_a_category_description\"><\/span>Can I add images to a category description?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Yes. Upload the image to the Media Library, copy its URL and add an &lt;img&gt; tag, or use your SEO plugin&#8217;s visual editor.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Is_it_safe_to_allow_scripts_in_category_descriptions\"><\/span>Is it safe to allow scripts in category descriptions?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Only for trusted administrators. Scripts can be abused if a less trusted account is compromised.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Why_is_my_category_description_not_showing\"><\/span>Why is my category description not showing?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Your theme probably does not call the_archive_description(). Add it to the template or use the Term Description block.<\/p>\n<p>Do you write category descriptions on your blog? Tell us in the comments.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Can you add HTML and scripts to WordPress category descriptions? Category and tag pages can rank well in Google, but&#8230;<\/p>\n","protected":false},"author":4,"featured_media":64034,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[6],"tags":[49,17],"class_list":["post-19520","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogging","tag-tutorials","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/19520","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/comments?post=19520"}],"version-history":[{"count":3,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/19520\/revisions"}],"predecessor-version":[{"id":65406,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/19520\/revisions\/65406"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media\/64034"}],"wp:attachment":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media?parent=19520"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/categories?post=19520"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/tags?post=19520"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}