Title: Modify JSON response
Last modified: August 21, 2016

---

# Modify JSON response

 *  [Shijo64](https://wordpress.org/support/users/shijo64/)
 * (@shijo64)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/modify-json-response/)
 * Hi, I want to know if there is any way to modify the JSON that I get when using
   get_post function?, I need to modify it, thanks in advance
 * [https://wordpress.org/plugins/json-api/](https://wordpress.org/plugins/json-api/)

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

 *  [Cadu de Castro Alves](https://wordpress.org/support/users/cadudecastroalves/)
 * (@cadudecastroalves)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/modify-json-response/#post-4776971)
 * You can use `json_api_encode` filter, like the following example:
 * > function turismogdf_remove_html_tags( $response ) {
   >  $post = ”; if( isset( 
   > $response[‘posts’] ) ) { foreach( $response[‘posts’] as $post ) { $post->content
   > = strip_tags( $post->content ); $post->excerpt = strip_tags( $post->excerpt);}}
   > else if( $response[‘post’] ) { $post = $response[‘post’]; $post->content = 
   > strip_tags( $post->content ); $post->excerpt = strip_tags( $post->excerpt );}
   > return $response; } add_filter( ‘json_api_encode’, ‘turismogdf_remove_html_tags’);
 *  [Marcos Curvello](https://wordpress.org/support/users/curvellomarcos/)
 * (@curvellomarcos)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/modify-json-response/#post-4777008)
 * [@cadu](https://wordpress.org/support/users/cadu/) de Castro Alves
 * Hey where do I place the following code?
 * I’m creating a iOS app, and I am using this JSON plugin to convert wp data so
   the app can consume it. But when the app parses the JSON there many unwanted 
   html tags and html special characters.
 * I’m having a hard time customizing this plugin, for example this section:
 * 3.1. Output-modifying arguments.
 * I want change these settings and see which will work best for me , but I don’t
   know where to insert these lines:
 *     ```
       json_unescaped_unicode
       json_encode
       ```
   
 * Help me out please, can you point me to in the right direction here ?
 * Thanks in Advance

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

The topic ‘Modify JSON response’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/json-api.svg)
 * [JSON API](https://wordpress.org/plugins/json-api/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/json-api/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/json-api/)
 * [Active Topics](https://wordpress.org/support/plugin/json-api/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/json-api/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/json-api/reviews/)

## Tags

 * [json](https://wordpress.org/support/topic-tag/json/)
 * [Modify](https://wordpress.org/support/topic-tag/modify/)

 * 2 replies
 * 3 participants
 * Last reply from: [Marcos Curvello](https://wordpress.org/support/users/curvellomarcos/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/modify-json-response/#post-4777008)
 * Status: not resolved