Users can select multiple Categories for a post by default, that’s why WordPress use checkboxes in the Categories metabox. If you need to force the user select only one category, I have this little plugin for you.
Categories Metabox Enhanced is a new plugin released by us today. After installing it, you could replace the checkboxes with radio buttons or a select drop-down in the plugin’s Settings page. That’s how you can force the user select only one category.
The plugin is based on a useful library Taxonomy_Single_Term created by WebDevStudios, I found it when I did the research work on creating Categories Metabox Enhanced. For it’s not actually a WordPress plugin and only hosted on GitHub, I decided to integrated it to the plugin and implemented the options on the Settings.
This plugin works on all hierarchical taxonomies as long as you enable them on the Settings page. Other options you could change include:
- Priority and position of the metabox placement
- Title of the metabox
- If child-terms in the radio elements should be indenting
- If adding of new terms from the metabox is enable
There are a few screenshots from Categories Metabox Enhanced:
Please note that if there are multiple categories have been set for a post, after activated this plugin, there are only one category can be displayed as checked in Radio option type.
I’m a senior web developer helping clients build their websites to grow businesses. Currently I’m based in Taipei, Taiwan.
I write things about WordPress, AngularJS and life. Whenever you’d like to find someone to talk about these topics, just get in touch!