Title: Add code to REST API safely
Last modified: August 31, 2016

---

# Add code to REST API safely

 *  Resolved [fersamp](https://wordpress.org/support/users/fersamp/)
 * (@fersamp)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/add-code-to-rest-api-safely/)
 * HI,
    I’d need to add new custom enbdpoints to my wordpress site but I don’t know
   the correct way to add code safely. I don’t want that plugin update rewrite my
   custom code.
 * I need to add new endpoints but I didn’t undeerstand the way to do this reading
   the guide, I mean which files to add and where to add them.
 * Thank you everybody
 * [https://wordpress.org/plugins/json-rest-api/](https://wordpress.org/plugins/json-rest-api/)

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

 *  Plugin Author [Daniel Bachhuber](https://wordpress.org/support/users/danielbachhuber/)
 * (@danielbachhuber)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/add-code-to-rest-api-safely/#post-7074507)
 * Hi,
 * We recommend using [WP-API v2](https://wordpress.org/plugins/rest-api/) at this
   time. You can follow the [integration documentation](http://v2.wp-api.org/extending/adding/)
   to learn more about adding your own endpoints.
 *  Thread Starter [fersamp](https://wordpress.org/support/users/fersamp/)
 * (@fersamp)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/add-code-to-rest-api-safely/#post-7074524)
 * Yes, I saw it, but where I have to put that code?
 * I mean, in what file?
    I have to create another folder and create newe php files?
 * I have fear about plugin updating…
 *  Plugin Author [Daniel Bachhuber](https://wordpress.org/support/users/danielbachhuber/)
 * (@danielbachhuber)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/add-code-to-rest-api-safely/#post-7074526)
 * You can put the code in a secondary plugin, your custom theme, or a variety of
   places. How to write custom code for WordPress isn’t something we support in 
   the WP REST API support forum though.

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

The topic ‘Add code to REST API safely’ is closed to new replies.

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

 * 3 replies
 * 2 participants
 * Last reply from: [Daniel Bachhuber](https://wordpress.org/support/users/danielbachhuber/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/add-code-to-rest-api-safely/#post-7074526)
 * Status: resolved