Title: Categories or custom fields?
Last modified: August 30, 2016

---

# Categories or custom fields?

 *  [Perotin](https://wordpress.org/support/users/perotin/)
 * (@perotin)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/categories-or-custom-fields-1/)
 * Hi, I have a website where I publish projects which are assigned with some custom
   fields. I use these fields: Type of the project, Status, Material, Location, 
   Date and some more. I want them to act like categories – when I click on the 
   value (for example Wood for the Material field) I want it to show me all the 
   post categorized under “Wood”.
 * Should I use categories for this and display them in different parent groups 
   that I mentioned (too many categories for one post?) or should I use custom fields(
   they are not clickable).
 * Example:
 * Country: **Austria**
    Year: **2006** Material: **Wood** Status: **Built**
 * Thanks 😉

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

 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/categories-or-custom-fields-1/#post-6797606)
 * I’d set them up as custom taxonomies and attach them to the post type that you’re
   using for the projects. That way they’re all set up the same was as categories,
   and will all have archive pages available in the same way.
 *  Thread Starter [Perotin](https://wordpress.org/support/users/perotin/)
 * (@perotin)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/categories-or-custom-fields-1/#post-6797652)
 * Thanks. Can I have both categories and custom taxonomies in a post? I use the
   default post type.
 *  [potentdevelopment](https://wordpress.org/support/users/potentdevelopment/)
 * (@potentdevelopment)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/categories-or-custom-fields-1/#post-6797653)
 * Taxonomies are a form of categories, why don’t you just do the whole structure
   in your custom taxonomy.
 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/categories-or-custom-fields-1/#post-6797654)
 * As potentdevelopment said, Categories are just a Taxonomy, and you can add extra
   taxonomies to any post type that you like, as well as adding as many as you like
   to the standard post type(s). As an example…
 * `register_taxonomy( 'country', 'post', array ('label' => 'Country') );`
 *  [megafreechips](https://wordpress.org/support/users/megafreechips/)
 * (@megafreechips)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/categories-or-custom-fields-1/#post-6797655)
 * You can create non-hierarchal tag-like custom taxonomies for each field.
    Country,
   Year, Material, Status. Then, you can pre-populate within your theme’s functions.
   php file the most common fields to be ready for use. As a rule of thumb I tend
   to use Taxonomies when I want to group posts by a specific criteria. And custom
   fields when I want to sort or filter a certain post-type by these fields. I think
   in your case, using custom-taxonomies would be the way to go. You’l benefit from
   their built-in url structure and ease of use. Furthermore, in the future if you’l
   want to filter by multiple taxonomies, for example: Projects in **Australia****
   built** with **Wood** in **2006**. It would be easy to implement if you used 
   taxonomies.
 *  Thread Starter [Perotin](https://wordpress.org/support/users/perotin/)
 * (@perotin)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/categories-or-custom-fields-1/#post-6797724)
 * wow, thanks. it works. I used this code to register the custom taxonomy
 *     ```
       add_action( 'init', 'create_material_taxonomy' );
   
       function create_material_taxonomy() {
       	$labels = array(
       		'name'                           => 'Materials',
       		'singular_name'                  => 'Material',
       		'search_items'                   => 'Search Materials',
       		'all_items'                      => 'All Materials',
       		'edit_item'                      => 'Edit Material',
       		'update_item'                    => 'Update Material',
       		'add_new_item'                   => 'Add New Material',
       		'new_item_name'                  => 'New Material Name',
       		'menu_name'                      => 'Material',
       		'view_item'                      => 'View Material',
       		'popular_items'                  => 'Popular Materials',
       		'separate_items_with_commas'     => 'Separate materials with commas',
       		'add_or_remove_items'            => 'Add or remove materials',
       		'choose_from_most_used'          => 'Choose from the most used materials',
       		'not_found'                      => 'No materials found'
       	);
   
       	register_taxonomy(
       		'materials',
       		'post',
       		array(
       			'label' => __( 'Material' ),
       			'hierarchical' => true,
       			'labels' => $labels,
       			'public' => true,
       			'show_in_nav_menus' => true,
       			'show_tagcloud' => false,
       			'show_admin_column' => true,
       			'rewrite' => array(
       				'slug' => 'materials'
       			)
       		)
       	);
       }
       ```
   
 * I have also installed this plugin to filter multiple taxonomies: [https://wordpress.org/plugins/search-filter](https://wordpress.org/plugins/search-filter)
 * thank you very much! 🙂

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

The topic ‘Categories or custom fields?’ is closed to new replies.

## Tags

 * [category](https://wordpress.org/support/topic-tag/category/)
 * [custom field](https://wordpress.org/support/topic-tag/custom-field/)
 * [custom taxonomy](https://wordpress.org/support/topic-tag/custom-taxonomy/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 4 participants
 * Last reply from: [Perotin](https://wordpress.org/support/users/perotin/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/categories-or-custom-fields-1/#post-6797724)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
