[![How to Disable the JSON REST API in WordPress 1](https://coma.lv/wp-content/uploads/2024/11/Gemini_Generated_Image_8ga8ww8ga8ww8ga8-2000px.webp)](https://coma.lv/wp-content/uploads/2024/11/Gemini_Generated_Image_8ga8ww8ga8ww8ga8-2000px-1030x396.webp)

# How to Disable the JSON REST API in WordPress

Nov 24, 2024/by [Vadim Pavlovich](https://coma.lv/en/author/djcoma/)

WordPress 4.4 introduced the JSON REST API, which many people dislike: it is ideal for plugin developers but entirely unsuitable for ordinary site owners. In this article we will show you how to easily disable the JSON REST API in WordPress.

## Why Disable the JSON REST API in WordPress?

Nobody argues that the API brings a lot of benefit to WordPress developers. However, some site owners do not use these features at all. The API makes it very easy to receive GET requests, which is incredibly useful for building applications on WordPress. However, it can also make your site much more vulnerable to DDoS attacks. It can also be quite resource-hungry and make your site slower. The process of disabling it is essentially similar to disabling XML-RPC, which many site owners also turn off.

## Disabling the JSON REST API in WordPress

If you want to disable the JSON REST API in WordPress, you can easily do it by simply adding the following code to the functions.php file:

add_filter(&#039;json_enabled&#039;, &#039;__return_false&#039;); add_filter(&#039;json_jsonp_enabled&#039;, &#039;__return_false&#039;);

This code simply uses built-in filters to disable the JSON and JSONP API. Those of you who do not want to add code manually can install and activate the Disable JSON API plugin, which works right after installation and requires no configuration. Simply activating the plugin will disable the API on your site.

---

*Our specialization is WordPress website development and maintenance. Contact us for a free consultation — [vadim@coma.lv](mailto:vadim@coma.lv), [+371 29394520](tel:+37129394520)*

---
