Title: JSON REST API (WP API) Categories and Tags
Author: WizADSL
Published: <strong>17 September 2014</strong>
Last modified: 20 September 2014

---

Search plugins

This plugin **hasn’t been tested with the latest three 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/json-rest-api-wp-api-categories-and-
tags.svg)

# JSON REST API (WP API) Categories and Tags

 By [WizADSL](https://profiles.wordpress.org/wizadsl/)

[Download](https://downloads.wordpress.org/plugin/json-rest-api-wp-api-categories-and-tags.1.01.zip)

 * [Details](https://en-gb.wordpress.org/plugins/json-rest-api-wp-api-categories-and-tags/#description)
 * [Reviews](https://en-gb.wordpress.org/plugins/json-rest-api-wp-api-categories-and-tags/#reviews)
 *  [Installation](https://en-gb.wordpress.org/plugins/json-rest-api-wp-api-categories-and-tags/#installation)
 * [Development](https://en-gb.wordpress.org/plugins/json-rest-api-wp-api-categories-and-tags/#developers)

 [Support](https://wordpress.org/support/plugin/json-rest-api-wp-api-categories-and-tags/)

## Description

The [JSON REST API (WP API)](https://wordpress.org/plugins/json-rest-api/) as of
version 1.1.1 does not allow you to specify tags or categories
 when createing or
editing posts (it appears this will be added in a later release). This plugin addresses
that problem by allowing categories and tags to be passed in the JSON data when 
creating/editing posts.

An example JSON post that can be made using the [JSON REST API (WP API)](https://wordpress.org/plugins/json-rest-api/)(
described in detail [here](http://wp-api.org/#posts_create-a-post)) to create a 
post in WordPress would be:

    ```
    {"title":"Hello World!","content_raw":"Content","excerpt_raw":"Excerpt"}
    ```

In order to add tags/categories you would add an array called “x-categories” and/
or and array called “x-tags” to the JSON data, for example:

    ```
    {"title":"Hello World!","content_raw":"Content","excerpt_raw":"Excerpt","x-tags":["tag1","tag2"],"x-categories":["General","15"]}
    ```

The example creates a post and assignes the tags “tag1” and “tag2” as well as placing
the post in the category named “General” and category ID 15. The tags do not have
to exist prior to use. Categories must exist prior to use and may be expressed and
either category names or category IDs. The “x-” prefixes were used to avoid any 
conflicts in functionality with the [JSON REST API (WP API)](https://wordpress.org/plugins/json-rest-api/)
plugin.

Because this plugin relies on the JSON parsing functionallity provided by the [JSON REST API (WP API)](https://wordpress.org/plugins/json-rest-api/)
plugin the alternate syntax using a multi-part-form body should also work.

By default the tags/categories specified when editing a post will replace any tags/
categories already assigned to the post. This behavior can be changed so that tags/
categories are appened instead, simply open the `json-rest-api-wp-api-categories-
and-tags` folder in the WordPress plugins folder and edit `json-rest-api-patch.php`.
On
 line 12 of the file is a variable that should be set to `true` in order to have
tags/categories appended instead of replaced.

## Installation

 1. Upload the `json-rest-api-patch` folder to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress

## Reviews

There are no reviews for this plugin.

## Contributors and Developers

“JSON REST API (WP API) Categories and Tags” is open source software. The following
people have contributed to this plugin.

Contributors

 *   [ WizADSL ](https://profiles.wordpress.org/wizadsl/)

[Translate “JSON REST API (WP API) Categories and Tags” into your language.](https://translate.wordpress.org/projects/wp-plugins/json-rest-api-wp-api-categories-and-tags)

### Interested in development?

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

## Change Log

#### 1.0

 * Initial release

#### 1.01

 * Fixed category id integer check; thanks to trevordevore

## Meta

 *  Version **1.01**
 *  Last updated **12 years ago**
 *  Active installations **30+**
 *  WordPress version ** 3.9 or higher **
 *  Tested up to **4.0.38**
 *  Language
 * [English (US)](https://wordpress.org/plugins/json-rest-api-wp-api-categories-and-tags/)
 * Tags
 * [api](https://en-gb.wordpress.org/plugins/tags/api/)[JSON](https://en-gb.wordpress.org/plugins/tags/json/)
   [patch](https://en-gb.wordpress.org/plugins/tags/patch/)[rest](https://en-gb.wordpress.org/plugins/tags/rest/)
   [rest-api](https://en-gb.wordpress.org/plugins/tags/rest-api/)
 *  [Advanced View](https://en-gb.wordpress.org/plugins/json-rest-api-wp-api-categories-and-tags/advanced/)

## Ratings

 5 out of 5 stars.

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

[Your review](https://wordpress.org/support/plugin/json-rest-api-wp-api-categories-and-tags/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/json-rest-api-wp-api-categories-and-tags/reviews/)

## Contributors

 *   [ WizADSL ](https://profiles.wordpress.org/wizadsl/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/json-rest-api-wp-api-categories-and-tags/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=58CC2KYQR64XW)