Title: Require Post Category
Author: Josh Hartman
Published: <strong>2011-يىلى 14-فېۋرال</strong>
Last modified: 2024-يىلى 5-ئاپرېل

---

قىستۇرما ئىزدە

![](https://ps.w.org/require-post-category/assets/banner-772x250.png?rev=1603108)

This plugin **hasn’t been tested with the latest 3 major releases of WordPress**.
It may no longer be maintained or supported and may have compatibility issues when
used with more recent versions of WordPress.

![](https://ps.w.org/require-post-category/assets/icon-256x256.png?rev=1603108)

# Require Post Category

 يازغۇچى [Josh Hartman](https://profiles.wordpress.org/joshhartman/)

[چۈشۈر](https://downloads.wordpress.org/plugin/require-post-category.2.1.zip)

 * [تەپسىلاتلار](https://ug.wordpress.org/plugins/require-post-category/#description)
 * [باھالاشلار](https://ug.wordpress.org/plugins/require-post-category/#reviews)
 *  [ئورنىتىش](https://ug.wordpress.org/plugins/require-post-category/#installation)
 * [ئىجادىيەت](https://ug.wordpress.org/plugins/require-post-category/#developers)

 [قوللاش](https://wordpress.org/support/plugin/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.

#### Translators

 * French (fr_FR) – Dominique V.
 * Spanish (es_ES) – [Andrew Kurtis – WebHostingHub](http://www.webhostinghub.com)
 * Polish (pl_PL) – Michał Papliński
 * Finnish (fi) – Sanapaino

If you have created your own language pack, or have an update of an existing one,
you can send the [PO and MO files](https://codex.wordpress.org/Translating_WordPress)
to [me](https://www.warpconduit.net/contact) so that I can bundle it into the plugin.
[Download the latest POT file](https://plugins.svn.wordpress.org/require-post-category/trunk/languages/require-post-category.pot).

## ئېكران كەسمىسى

 * [[
 * 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.

#### From WordPress.org

 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.

## FAQ

### 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
            'manufacturer',
            // 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 https://wordpress.org/support/plugin/
require-post-category

## باھالاشلار

![](https://secure.gravatar.com/avatar/c786390f81ee978c57d2648023319ac6dd9c2ddd633574e42c5252a8815e55df?
s=60&d=retro&r=g)

### 󠀁[Easy and Effective](https://wordpress.org/support/topic/easy-and-effective-194/)󠁿

 [Daniel Hendricks](https://profiles.wordpress.org/hendridm/) 2020-يىلى 12-ماي

Simply install the plugin and activate. Works with both classic and block editors.
Nice work.

![](https://secure.gravatar.com/avatar/ddbb224ebfaed78185b376184223673e1c544842588e6f8f866baae9dcf11c47?
s=60&d=retro&r=g)

### 󠀁[Works perfectly with no fuss](https://wordpress.org/support/topic/works-perfectly-with-no-fuss/)󠁿

 [wpguillaume](https://profiles.wordpress.org/wpguillaume/) 2020-يىلى 10-فېۋرال

And now with Gutenberg support. 🙂 No settings needed, install, activate, enjoy.
Thank you!

![](https://secure.gravatar.com/avatar/8a385945663a7184158190061e544c0e7ce1615c1ab222cb9cef20c5aa538251?
s=60&d=retro&r=g)

### 󠀁[Great!](https://wordpress.org/support/topic/great-10832/)󠁿

 [Sanapaino](https://profiles.wordpress.org/sanapaino/) 2020-يىلى 6-فېۋرال

A plugin as a plugin should be: simple but useful.

![](https://secure.gravatar.com/avatar/35745cbb4065201434c30aad2e5980133a6a987f4dbbba485c04da8d57601f26?
s=60&d=retro&r=g)

### 󠀁[excellent plugin](https://wordpress.org/support/topic/excellent-plugin-5530/)󠁿

 [Groovyx9](https://profiles.wordpress.org/groovyx9/) 2020-يىلى 4-فېۋرال

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.

![](https://secure.gravatar.com/avatar/7edb385ef2f6367a6799aff8d1bb33dd540bc19fffe982db7f2740ef4e7e2282?
s=60&d=retro&r=g)

### 󠀁[works with cpt!](https://wordpress.org/support/topic/works-with-cpt/)󠁿

 [nsultan](https://profiles.wordpress.org/nsultan/) 2019-يىلى 16-ئىيۇن

perfect!

![](https://secure.gravatar.com/avatar/564da5b47c062461dc7ce7cd93b1a895f02b02ec511cef20b1b3db5b988832a3?
s=60&d=retro&r=g)

### 󠀁[Works!](https://wordpress.org/support/topic/works-1431/)󠁿

 [seobootuz](https://profiles.wordpress.org/seobootuz/) 2018-يىلى 17-ئىيۇن

Using for custom post type with custom taxonomy. Great plugin.

 [ 11 باھالاشنىڭ ھەممىنى ئوقۇش ](https://wordpress.org/support/plugin/require-post-category/reviews/)

## تۆھپىكار ۋە ئىجادكار

«Require Post Category» كودى ئوچۇق يۇمشاق دېتال. تۆۋەندىكى كىشىلەر بۇ قىستۇرمىغا
تۆھپە قوشقان.

تۆھپىكار

 *   [ Josh Hartman ](https://profiles.wordpress.org/joshhartman/)

«Require Post Category» 1 تىلغا تەرجىمە قىلىنغان. [تەرجىمانلار](https://translate.wordpress.org/projects/wp-plugins/require-post-category/contributors)
نىڭ تۆھپىسى ئۈچۈن رەھمەت.

[«Require Post Category» نى تىلىڭىزغا تەرجىمە قىلىڭ](https://translate.wordpress.org/projects/wp-plugins/require-post-category)

### ئىجادىيەتكە قىزىقامسىز؟

[كودقا كۆز يۈگۈرتۈپ](https://plugins.trac.wordpress.org/browser/require-post-category/)،
[SVN خەزىنە](https://plugins.svn.wordpress.org/require-post-category/) تەكشۈرۈپ 
ياكى [RSS](https://plugins.trac.wordpress.org/log/require-post-category/?limit=100&mode=stop_on_copy&format=rss)
ئارقىلىق [ئىجادىيەت خاتىرىسى](https://plugins.trac.wordpress.org/log/require-post-category/)
گە مۇشتەرى بولغىلى بولىدۇ.

## ئۆزگىرىش خاتىرىسى

#### 2.1

 * 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)

#### 2.0.3

 * Added Finnish (fi) translation by Sanapaino

#### 2.0.2

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

#### 2.0.1

 * Repaired translation files.

#### 2.0

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

#### 1.1

 * 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

#### 1.0.7

 * Moved JavaScript to separate file and updated to use `wp_enqueue_script` and `
   wp_localize_script`

#### 1.0.6

 * Added French (fr_FR) translation by Dominique V.

#### 1.0.5

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

#### 1.0.4

 * Added Spanish (es_ES) translation by Andrew K.

#### 1.0.3

 * Added i18n support

#### 1.0.2

 * Updated for WordPress 3.6

#### 1.0.1

 * FIXED: Disabled script when adding/editing pages

#### 1.0

 * First stable release

## Meta

 *  Version **2.1**
 *  ئاخىرقى يېڭىلانغان ۋاقىت **2 يىل بۇرۇن**
 *  ئاكتىپ ئورنىتىش سانى **1,000+**
 *  WordPress نەشرى ** 5.5 ياكى يۇقىرى **
 *  **6.5.8** دا سىنالغان
 *  تىل
 * [English (US)](https://wordpress.org/plugins/require-post-category/) ۋە [Swedish](https://sv.wordpress.org/plugins/require-post-category/).
 *  [تىلىڭىزغا تەرجىمە قىلىڭ](https://translate.wordpress.org/projects/wp-plugins/require-post-category)
 * بەلگە
 * [category](https://ug.wordpress.org/plugins/tags/category/)[post](https://ug.wordpress.org/plugins/tags/post/)
   [require](https://ug.wordpress.org/plugins/tags/require/)[tags](https://ug.wordpress.org/plugins/tags/tags/)
   [taxonomy](https://ug.wordpress.org/plugins/tags/taxonomy/)
 *  [ئالىي كۆرۈنۈش](https://ug.wordpress.org/plugins/require-post-category/advanced/)

## دەرىجە

 4.9/5 يۇلتۇز

 *  [  10 5-يۇلتۇز باھالاش     ](https://wordpress.org/support/plugin/require-post-category/reviews/?filter=5)
 *  [  1 4-يۇلتۇز باھالاش     ](https://wordpress.org/support/plugin/require-post-category/reviews/?filter=4)
 *  [  0 3-يۇلتۇز باھالاش     ](https://wordpress.org/support/plugin/require-post-category/reviews/?filter=3)
 *  [  0 2-يۇلتۇز باھالاش     ](https://wordpress.org/support/plugin/require-post-category/reviews/?filter=2)
 *  [  0 1-يۇلتۇز باھالاش     ](https://wordpress.org/support/plugin/require-post-category/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/require-post-category/reviews/#new-post)

[بارلىق ئىنكاسنى كۆرسەت](https://wordpress.org/support/plugin/require-post-category/reviews/)

## تۆھپىكار

 *   [ Josh Hartman ](https://profiles.wordpress.org/joshhartman/)

## قوللاش

چۈشەندۈرۈشىڭىز بارمۇ؟ ياردەم لازىممۇ؟

 [قوللاش مۇنبىرىنى كۆرسەت](https://wordpress.org/support/plugin/require-post-category/)