How to Disable JSON REST API in WordPress

| Last Updated: | In: WordPress, WP Labs


Hi friend, hope you are doing good. From 4.4 version WordPress has added the much-anticipated JSON REST API in build with WordPress Software. It is very helpful for theme & plugin developers, but many website owners may not find it useful for his WordPress websites at all.

So that in this tutorial, I will explain how to disable JSON REST API in WordPress websites. If you want to disable the REST API from your WordPress site, then keep your close attention in this post and follow the steps which I have mentioned below.

How to Disable JSON REST API in WordPress

How to Disable JSON REST API in WordPress

Add below code snippet at the end of the functions.php file in your current activated WordPress theme folder. Below WordPress filters will disable the JSON Rest API features from your WordPress blogs or websites.

Disable JSON REST API Using WordPress Plugin

There is also another option to disable the JSON REST API on your site. You can simply install this plugin and it will disable the REST API feature from your site.

This plugin works well with WordPress 4.4, 4.5, 4.6 and for the above version, it will return an authentication error that is you need to login to the website to access the JSON REST API.

Disable REST API WordPress Plugin

Download the latest version of Disable REST API plugin from wordpress.org and installed it with your WordPress website. If you have just started with WordPress Read:

After installed, activate this plugin via Plugins menu option and then try to access the REST API by using http://your-website-url.com/wp-json/ you will get an authentication error. See the below screenshot.

Wordpress-rest-api

Over To You

If you still need any help to disable the JSON REST API from your site, then feel free to add your comments in below comment section. I will be happy to help you to disable the JSON REST API on your site. Do you like & share this article with your friends, and don’t forget to follow us on Facebook and Twitter to learn cool WordPress tutorials.


About: Prem Tiwari

Prem Tiwari is the founder of freewebmentor.com and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby.


You may also like:


, , , , ,