Title: Automatic Categories from Posts
Last modified: April 27, 2017

---

# Automatic Categories from Posts

 *  Resolved [jhcolead](https://wordpress.org/support/users/jhcolead/)
 * (@jhcolead)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/automatic-categories-from-posts/)
 * Does anyone know if you can create new categories automatically when you create
   posts, pages or custom posts?
 * I’m looking for either a plugin that could handle it or advice if any one else
   has tried it.
 * Thanks

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [pxforti](https://wordpress.org/support/users/pxforti/)
 * (@pxforti)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/automatic-categories-from-posts/#post-9075195)
 * Not sure why you would do that. How would the plugin know what you wanted to 
   call the category?
 * Why not create a post and click new category. Then you can name it exactly how
   you want.
 *  Thread Starter [jhcolead](https://wordpress.org/support/users/jhcolead/)
 * (@jhcolead)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/automatic-categories-from-posts/#post-9077241)
 * It’s to call the category the same name as the post. Also to avoid any issues
   with spelling mistakes and repetition in categories.
 * I’m sure it’s do-able. Just wondered if anyone had come across it before.
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/automatic-categories-from-posts/#post-9079261)
 * You should recognize that your request does sound unusual. In a sense it is redundant
   and departs from typical uses of categories. All the same, it’s possible.
 * Hook one of the actions used when posts are inserted, like ‘save_post’. I’d suggest‘
   draft_to_publish’ because it is specific to new posts. But for any post type,
   so you should conditionally add categories based on post type if you have other
   post types associated with categories where this should not happen. However, 
   it will not pick up on changes to the title. If that’s required, used ‘save_post’
   and confirm if it fired for an update or not, and if so, if the title has changed.
 * In the action callback call [wp_insert_category()](https://developer.wordpress.org/reference/functions/wp_insert_category/).
 *  Thread Starter [jhcolead](https://wordpress.org/support/users/jhcolead/)
 * (@jhcolead)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/automatic-categories-from-posts/#post-9087855)
 * I do realise this is an odd question. Normally we would find these solutions 
   ourselves, but I wanted to open this up to the community to see what kind of 
   response I would get back.
 * We have a solution we are working on that already existed in another form. Just
   needs refinement.
 * Thanks for your replies and help.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Automatic Categories from Posts’ is closed to new replies.

## Tags

 * [-posting](https://wordpress.org/support/topic-tag/posting/)
 * [automation](https://wordpress.org/support/topic-tag/automation/)
 * [categories](https://wordpress.org/support/topic-tag/categories/)
 * [posts](https://wordpress.org/support/topic-tag/posts/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 4 replies
 * 3 participants
 * Last reply from: [jhcolead](https://wordpress.org/support/users/jhcolead/)
 * Last activity: [9 years, 1 month ago](https://wordpress.org/support/topic/automatic-categories-from-posts/#post-9087855)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
