WordPress allows you to organize posts using tags and categories, but sometimes you need more options. This is where custom taxonomies come in handy, allowing you to arrange content exactly how you want. For instance, a movie blog might use “Genres” or “Topics” to categorize posts. Once developed, you can easily display custom taxonomy terms on your website.
Displaying taxonomy terms in a sidebar widget enhances your website’s usability, making it easier for users to find content quickly. But how do you display taxonomy in a sidebar? This article outlines two simple methods—using a bit of code or a plugin. Even if you’re not a tech expert, you can follow these guidelines to showcase your custom taxonomy terms effectively.
In WordPress, taxonomies help organize and classify content. While the default taxonomies—tags and categories—serve most needs, they’re sometimes not enough. Custom taxonomies offer greater flexibility, allowing you to create labels based on your website’s specific content type or theme, enhancing site navigation and control.
Custom taxonomies can be attached to posts, pages, and custom post types, functioning much like tags or categories to speed up content searches and improve user experience.
Here are three straightforward techniques to showcase custom taxonomy keywords in your WordPress sidebar:
If you’re comfortable with programming, you can use a custom function to display terms anywhere on your site or in a widget.
Step 1: Register the Custom Taxonomy
You might have done this already, but if not, here’s an example code to create a new taxonomy called “Genre” for posts:
function create_custom_taxonomy() {
register_taxonomy(
'genre',
'post',
array(
'label' => 'Genres',
'rewrite' => array('slug' => 'genre'),
'hierarchical' => true,
)
);
}
add_action('init', 'create_custom_taxonomy');
Step 2: Display Custom Taxonomy Terms in the Sidebar Widget
Add the following code to your theme’s functions file or a custom plugin:
function display_genre_terms_widget() {
$terms = get_terms(array(
'taxonomy' => 'genre',
'hide_empty' => false,
));
if (!empty($terms) && !is_wp_error($terms)) {
echo '<ul>';
foreach ($terms as $term) {
$term_link = get_term_link($term);
echo '<li><a href="' . esc_url($term_link) . '">' . esc_html($term->name) . '</a></li>';
}
echo '</ul>';
}
}
function register_genre_widget() {
register_sidebar(array(
'name' => 'Custom Taxonomy Sidebar',
'id' => 'custom_taxonomy_sidebar',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
}
add_action('widgets_init', 'register_genre_widget');
Use this function in your sidebar template:
if (is_active_sidebar('custom_taxonomy_sidebar')) {
display_genre_terms_widget();
}
For those who prefer not to code, using a plugin is an excellent option. Many plugins, like a taxonomy widget plugin, allow widgets to display custom taxonomies.
Recommended Plugin: “Custom Taxonomy Widget”
Steps to Use:
Your sidebar will now display the taxonomy terms. Most plugins offer display options like dropdown menus or showing post counts.
WordPress’s block-based widget editor allows for more flexible design.
Steps to Use:
Certain plugins display taxonomies using shortcodes. You can paste these directly into the widget block.
The output will appear plain unless styled. Custom CSS can enhance its appearance.
Sample CSS:
.widget ul {
list-style: none;
padding: 0;
}
.widget ul li {
padding: 5px 0;
}
.widget ul li a {
color: #0073aa;
text-decoration: none;
}
.widget ul li a:hover {
text-decoration: underline;
}
Add this CSS by going to Appearance > Customize > Additional CSS.
Displaying custom taxonomy terms in your WordPress sidebar improves user experience and site navigation. Whether you prefer coding, using plugins, or the block editor, there’s a method suitable for every skill level. Custom taxonomies allow users to find relevant posts by organizing content more efficiently. Including taxonomy terms in your sidebar acts as a great filter, increasing user engagement and enhancing SEO. Don’t forget to style your widgets with CSS for a polished look. By applying these simple techniques, your WordPress site will become more aesthetically pleasing and user-friendly.
Learn how to compress images in PowerPoint to reduce file size without losing quality. Discover simple steps to make your presentations lighter and more efficient.
Learn how to add custom search engines to Chrome and explore 7 unique search engines that you need to try in 2025.
Learn how to bulk resize large WordPress images without losing quality using plugins like ShortPixel, EWWW, and TinyPNG.
Master uppercase formatting in Word, Excel, and other apps. Capitalize all letters for professional documents easily now.
Master uppercase formatting in Word, Excel, and other apps. Capitalize all letters for professional documents easily now.
Learn step-by-step methods to embed YouTube videos in PowerPoint—online, offline, or with advanced tools. Present with confidence.
Learn how to set unique avatars in WordPress without Gravatar using plugins. Enhance site branding, privacy, and user experience.
Learn how to avoid demonetization on YouTube by understanding new content, ad policy, and review rules that affect earnings.
Easy methods to limit WordPress Heartbeat API, boosting performance and cutting CPU usage without sacrificing core functionality.
Easily add a progress bar in WP posts using plugins, page builders, or custom code to boost reader engagement and site appeal.
Easily duplicate your WordPress menu with one click using a plugin. Save time, reduce errors, and keep your original menu safe.
Learn how to add stylish custom scrollbars to your WordPress site using plugins, CSS, or JavaScript—no coding skills needed, just simple steps.