Title: JSON format
Last modified: November 26, 2018

---

# JSON format

 *  Resolved [WP Craftbench](https://wordpress.org/support/users/kadecooper/)
 * (@kadecooper)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/json-format-3/)
 * I was able to get the content from our knowledgebase plugin to output content
   but is there a way to format it and/or remove the markup around the data?

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

 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/json-format-3/#post-10918882)
 * Hi [@kadecooper](https://wordpress.org/support/users/kadecooper/),
 * What markup are you referring to? Can you send me an example?
 * Thank you,
    Kevin.
 *  Thread Starter [WP Craftbench](https://wordpress.org/support/users/kadecooper/)
 * (@kadecooper)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/json-format-3/#post-10918900)
 * Here is the output of our knowledge base
    [https://www.omnidek.com/wp-json/wp/v2/epkb_post_type_1](https://www.omnidek.com/wp-json/wp/v2/epkb_post_type_1)
 * But it probably should be in a format similar to this
 * > [View post on imgur.com](https://imgur.com/4vkvlhI)
 * thanks for the prompt response
    Kade
    -  This reply was modified 7 years, 4 months ago by [WP Craftbench](https://wordpress.org/support/users/kadecooper/).
 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/json-format-3/#post-10918912)
 * The format is JSON. I’m using a Chrome extension that formats JSON results and
   here is a sample of what I see when I go to the link you sent: [https://imgur.com/a/yMw0Pqq](https://imgur.com/a/yMw0Pqq).
 * If you `json_decode()` this result in PHP or use `JSON.parse()` in your JavaScript,
   it should return a proper object.
 *  Thread Starter [WP Craftbench](https://wordpress.org/support/users/kadecooper/)
 * (@kadecooper)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/json-format-3/#post-10918934)
 * Thank you!!!! I’ll send this information on to the team.
 *  Thread Starter [WP Craftbench](https://wordpress.org/support/users/kadecooper/)
 * (@kadecooper)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/json-format-3/#post-10918945)
 * After thought, so this outputs inline css and html, is there a way to only pull
   the content?
 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/json-format-3/#post-10918959)
 * What you’re looking at in the screenshot is the value of the `post_content` field
   from the database. There’s HTML and CSS (in the screenshot) because there is 
   HTML and CSS in the post’s `post_content` field in the DB.
 * If you want to get rid of this, you have a few approaches. One would be to store
   the pure content in a meta field (this would be a bit tedious – you would need
   your content in two separate places and that’s never a good idea). Another approach
   could be to strip the tags using functions like `wp_kses()` and `preg_replace()`.
   There are _a lot_ of resources online (especially regular expressions) showing
   how to strip tags while preserving content.
 * Cheers,
    Kevin.

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

The topic ‘JSON format’ is closed to new replies.

 * ![](https://ps.w.org/wp-rest-api-controller/assets/icon-256x256.png?rev=2489942)
 * [WP REST API Controller](https://wordpress.org/plugins/wp-rest-api-controller/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-rest-api-controller/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-rest-api-controller/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-rest-api-controller/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-rest-api-controller/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-rest-api-controller/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * Last activity: [7 years, 4 months ago](https://wordpress.org/support/topic/json-format-3/#post-10918959)
 * Status: resolved