Title: WP REST API &#8211; Pure Taxonomies
Author: Andrew MAGIK
Published: <strong>February 12, 2016</strong>
Last modified: March 1, 2016

---

Search plugins

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://s.w.org/plugins/geopattern-icon/wp-rest-api-pure-taxonomies.svg)

# WP REST API – Pure Taxonomies

 By [Andrew MAGIK](https://profiles.wordpress.org/magikru/)

[Download](https://downloads.wordpress.org/plugin/wp-rest-api-pure-taxonomies.1.0.zip)

 * [Details](https://wordpress.org/plugins/wp-rest-api-pure-taxonomies/#description)
 * [Reviews](https://wordpress.org/plugins/wp-rest-api-pure-taxonomies/#reviews)
 *  [Installation](https://wordpress.org/plugins/wp-rest-api-pure-taxonomies/#installation)
 * [Development](https://wordpress.org/plugins/wp-rest-api-pure-taxonomies/#developers)

 [Support](https://wordpress.org/support/plugin/wp-rest-api-pure-taxonomies/)

## Description

Now you have no need to make additional requests to get taxonomy info (term_id, 
name, slug, term_group, term_taxonomy_id, taxonomy, description, parent, count, 
filter) from their id that is available in the default json response.

Now all available taxonomy data is available in ‘pure_taxonomies’ field from your
json response. It works for all custom added taxonomies, and for custom post types.

For example in ‘wp-json/wp/v2/posts’ you can find default fields ‘categories’, ‘
tags’ and name of custom added taxonomies that contain only its id. With this plugin
you can also find new ‘pure_taxonomies’ field that include all available ‘categories’,‘
tags’ and custom taxonomies data.

**Before:**
 { … categories: [ 3 ], tags: [ 2 ], custom_taxonomy_name: [ 1 ] … }

**After:**
 { … pure_taxonomies: { categories: [ { term_id: 3, name: “First category”,
slug: “first-category”, term_group: 0, term_taxonomy_id: 3, taxonomy: “category”,
description: “”, parent: 0, count: 3, filter: “raw”, cat_ID: 3, category_count: 
3, category_description: “”, cat_name: “First category”, category_nicename: “first-
category”, category_parent: 0 } ], tags: [ { term_id: 2, name: “First tag”, slug:“
first-tag”, term_group: 0, term_taxonomy_id: 2, taxonomy: “post_tag”, description:“”,
parent: 0, count: 2, filter: “raw” } ], custom_taxonomy_name: [ { term_id: 1, name:“
Custom Taxonomy Name”, slug: “custom-taxonomy-name”, term_group: 0, term_taxonomy_id:
1, taxonomy: “custom_taxonomy_name”, description: “”, parent: 0, count: 1, filter:“
raw” } ] } … }

Check my other useful rest-api plugins: [https://wordpress.org/plugins/tags/andrew-magik-rest-api](https://wordpress.org/plugins/tags/andrew-magik-rest-api).

## Installation

 1. Double check you have the WordPress REST (v2) API installed and active
 2. Upload the plugin folder to the `/wp-content/plugins/` directory, or install the
    plugin through the WordPress plugins screen directly.
 3. Activate the plugin through the ‘Plugins’ screen in WordPress

## FAQ

  How to add custom taxonomies into Rest API:

/**
 * Add REST API support to an already registered taxonomy. */ add_action( ‘init’,‘
my_custom_taxonomy_rest_support’, 25 ); function my_custom_taxonomy_rest_support(){
global $wp_taxonomies;

    ```
            //Here should be a list of names of the already created custom taxonomies:
            $taxonomy_names = array(
                'clients',
                'technologies'
            );
            foreach ( $taxonomy_names as $key => $taxonomy_name ) {
                if (isset($wp_taxonomies[$taxonomy_name])) {
                    $wp_taxonomies[$taxonomy_name]->show_in_rest = true;
                    $wp_taxonomies[$taxonomy_name]->rest_base = $taxonomy_name;
                    $wp_taxonomies[$taxonomy_name]->rest_controller_class = 'WP_REST_Terms_Controller';
                }
            }
        }
    ```

  How to add custom post type into Rest API:

/**
 * Add REST API support to an already registered post type. */ add_action( ‘
init’, ‘my_custom_post_type_rest_support’, 25 ); function my_custom_post_type_rest_support(){
global $wp_post_types;

    ```
            //Here should be a name of your already created custom post type:
            $post_type_name = 'portfolio';
            if( isset( $wp_post_types[ $post_type_name ] ) ) {
                $wp_post_types[$post_type_name]->show_in_rest = true;
                $wp_post_types[$post_type_name]->rest_base = $post_type_name;
                $wp_post_types[$post_type_name]->rest_controller_class = 'WP_REST_Posts_Controller';
            }
        }
    ```

  Do you have other useful REST-API plugins?

Yes, I have. You can check them by tag: [https://wordpress.org/plugins/tags/andrew-magik-rest-api](https://wordpress.org/plugins/tags/andrew-magik-rest-api).

## Reviews

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

### 󠀁[Just works 🙂](https://wordpress.org/support/topic/just-works-412/)󠁿

 [dagvon](https://profiles.wordpress.org/dagvon/) February 6, 2018

Works right out of the box.

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

### 󠀁[PERFECT!](https://wordpress.org/support/topic/perfect-999/)󠁿

 [Rory Michael Heaney](https://profiles.wordpress.org/rorymheaney/) October 8, 2016

Works just as described and will save you a ton of time without having to make all
those additional API calls

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

### 󠀁[very helpful function](https://wordpress.org/support/topic/very-helpful-function/)󠁿

 [jarnoschi](https://profiles.wordpress.org/jarnoschi/) September 3, 2016

to directly access taxonomy details from GET posts. thanks for the work

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

### 󠀁[Works Perfectly](https://wordpress.org/support/topic/works-perfectly-822/)󠁿

 [David Massiani](https://profiles.wordpress.org/david-massiani/) September 3, 2016

Good job!

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

### 󠀁[Very useful to reduce number of requests](https://wordpress.org/support/topic/very-useful-to-reduce-number-of-requests/)󠁿

 [Andrew MAGIK](https://profiles.wordpress.org/magikru/) September 3, 2016

Very useful to reduce number of requests

 [ Read all 5 reviews ](https://wordpress.org/support/plugin/wp-rest-api-pure-taxonomies/reviews/)

## Contributors & Developers

“WP REST API – Pure Taxonomies” is open source software. The following people have
contributed to this plugin.

Contributors

 *   [ Andrew MAGIK ](https://profiles.wordpress.org/magikru/)

[Translate “WP REST API – Pure Taxonomies” into your language.](https://translate.wordpress.org/projects/wp-plugins/wp-rest-api-pure-taxonomies)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/wp-rest-api-pure-taxonomies/),
check out the [SVN repository](https://plugins.svn.wordpress.org/wp-rest-api-pure-taxonomies/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/wp-rest-api-pure-taxonomies/)
by [RSS](https://plugins.trac.wordpress.org/log/wp-rest-api-pure-taxonomies/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.0

 * Initial release!

## Meta

 *  Version **1.0**
 *  Last updated **10 years ago**
 *  Active installations **400+**
 *  WordPress version ** 4.4 or higher **
 *  Tested up to **4.4.34**
 * Tags
 * [api](https://wordpress.org/plugins/tags/api/)[categories](https://wordpress.org/plugins/tags/categories/)
   [rest-api](https://wordpress.org/plugins/tags/rest-api/)[taxonomies](https://wordpress.org/plugins/tags/taxonomies/)
   [wp-api](https://wordpress.org/plugins/tags/wp-api/)
 *  [Advanced View](https://wordpress.org/plugins/wp-rest-api-pure-taxonomies/advanced/)

## Ratings

 5 out of 5 stars.

 *  [  5 5-star reviews     ](https://wordpress.org/support/plugin/wp-rest-api-pure-taxonomies/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/wp-rest-api-pure-taxonomies/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/wp-rest-api-pure-taxonomies/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/wp-rest-api-pure-taxonomies/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/wp-rest-api-pure-taxonomies/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/wp-rest-api-pure-taxonomies/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/wp-rest-api-pure-taxonomies/reviews/)

## Contributors

 *   [ Andrew MAGIK ](https://profiles.wordpress.org/magikru/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/wp-rest-api-pure-taxonomies/)