Use Radio Buttons in Your Categories Metabox

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.

8 thoughts on “Use Radio Buttons in Your Categories Metabox”

  1. A neat plugin although there are others with the same functionality.

    An enhancement for the categories metabox I’ve often needed but never been able to find is a series of groups with radio buttons permitting only one selection from each group.

    We do some work with school news blogs where the author is required to make selections of a few categories – is this a featured post, what grade or year level does it apply to, and what academic subject ?

    With the correct selections the posts appears in the right places on the site, but it’s confusing for the user to be presented with a long list of choices in a metabox. Using parent/child categories helps but still allows multiple selections in the child categories.

    These can all be covered with custom fields of course but that adds an extra layer of complication and makes theme changing by the clients difficult.

    Reply
  2. hi, Trevor,

    How about creating custom taxonomies (as groups) and apply the single term UI to them with my plugin? It might meet your expectation but will need extra work to convert current categories to them.

    Reply

Leave a Comment