Require Post Category


Tired of uncategorized posts? Use this simple plugin to require users to choose a post category before updating or publishing a post. By default this only applies to normal posts. If you wish to require a category/taxonomy for a custom post type see the FAQ for filter hook usage examples.


If you have created your own language pack, or have an update of an existing one, you can send the PO and MO files to me so that I can bundle it into the plugin. Download the latest POT file.


  • Notice appears when editing a post without selecting a category (Gutenberg)
  • Alert appears when you try to save a post without selecting a category (Classic)


From your WordPress dashboard

  1. Visit ‘Plugins > Add New’
  2. Search for ‘require post category’ and click the Install button
  3. Activate Require Post Category from your Plugins page.


  1. Download Require Post Category.
  2. Upload the ‘require-post-category’ directory to your ‘/wp-content/plugins/’ directory, using your favorite method (ftp, sftp, scp, etc…)
  3. Activate Require Post Category from your Plugins page.


Are there any settings I can adjust?

Nope, just install and activate, that’s it!

How do I use this for custom post types and/or custom taxonomies?

Use the rpc_post_types filter hook in your theme’s functions.php or a must-use plugin.

Usage examples:

function custom_rpc_post_types( $post_types ) {
    // Add a key to the $post_types array for each post type and list the slugs of the taxonomies you wish to require

    // Simplest usage
    $post_types['book'] = array( 'genre' );

    // Multiple taxonomies
    $post_types['recipe'] = array( 'cookbook_category', 'geographic_origin', 'flavor_tags' );

    // Set your own alert message for each taxonomy, or let the plugin generate the alert message
    $post_types['inventory'] = array(
        // Let the plugin generate a relevant alert message
        // Or specify a custom alert message
        'inventory_category' => array(
            'message' => "Please choose a category for this fine inventory item."

    // Always return $post_types after your modifications
    return $post_types;

add_filter( 'rpc_post_types', 'custom_rpc_post_types' );

The default $post_types contains the following:

$post_types['post'] = array(
    'category' => array(
        'message' => 'Please select a category before publishing this post.'

This maintains the plugin’s original functionality. However, you can remove this functionality with unset($post_types['post']); or by redefining $post_types in your hook function.

You’ve added code to require a custom taxonomy but can’t get it to work in the Gutenberg editor?

One reason may be that your custom taxonomy does not have the show_in_rest argument enabled. Without it enabled the Gutenberg editor cannot access it.

Have a question that is not addressed here?

Visit this plugin’s WordPress support forum at


6 februari 2020
A plugin as a plugin should be: simple but useful.
4 februari 2020
I was so glad to have found this plugin a few years ago : as each post on my site is right away transformed into a newsletter according to categories, forgetting to add a category means a painful process of deleting and creating again. This plugin is just perfect to avoid such a situation… and now I can see it is updated 🙂 So 5 stars.
17 juni 2018
Using for custom post type with custom taxonomy. Great plugin.
Lees alle 11 beoordelingen

Bijdragers & ontwikkelaars

“Require Post Category” is open source software. De volgende personen hebben bijgedragen aan deze plugin.


“Require Post Category” is vertaald in 1 taal. Dank voor de vertalers voor hun bijdragen.

Vertaal “Require Post Category” naar jouw taal.

Interesse in ontwikkeling?

Bekijk de code, haal de SVN repository op, of abonneer je op het ontwikkellog via RSS.



  • Updated for WordPress 5.5
  • FIXED: Deprecated function notice listed in jQuery Migrate Helper plugin (Classic Editor)
  • FIXED: Submitting post form by pressing enter in the title field would bypass checks (Classic Editor)


  • Added Finnish (fi) translation by Sanapaino


  • FIXED: Custom taxonomy rest_base value of boolean false was not being properly handled.


  • Repaired translation files.


  • Rewritten for the new Gutenberg editor (first introduced in WordPress 5.0)


  • NEW: Added a filter hook and related code to allow developers to easily add support for custom post types and custom taxonomies
  • Updated to meet WordPress PHP coding standards


  • Moved JavaScript to separate file and updated to use wp_enqueue_script and wp_localize_script


  • Added French (fr_FR) translation by Dominique V.


  • Added Polish (pl_PL) translation by Michał P.


  • Added Spanish (es_ES) translation by Andrew K.


  • Added i18n support


  • Updated for WordPress 3.6


  • FIXED: Disabled script when adding/editing pages


  • First stable release