PHP

How to Disable WP JSON Rest API in WordPress without plugin ?

just add below code in wordpress theme function.php file at the bottom

--------------------------------------------------
Add the following code to functions.php (anyone)
--------------------------------------------------


if( ! is_user_logged_in() ) {
remove_action('rest_api_init', 'create_initial_rest_routes', 99);
}


-----------------------------------
OR
-----------------------------------


remove_action('rest_api_init', 'create_initial_rest_routes', 99);

------------------------------------------
Check if your site's username is exposed
------------------------------------------
website-URL.com/wp-json/wp/v1/users
website-URL.com/wp-json/wp/v2/users
website-URL.com/wp-json/
remove_action('rest_api_init','create_initial_rest_routes',99);
Basant

Recent Posts

AWS

Steps: AWS puttyubuntu sudo su apt update apt install apache2 service apache2 start service apache2…

3 days ago

How to Center submit button of wpForm

You must navigate to Settings ยป General first. Add wpf-center to the Form CSS Class…

8 months ago

How to add Marquee on any website wordpress,PHP,HTML,eBlogger ?

if you want to add marquee on any website (wordpress,PHP,HTML,Blogger). you just need to follow…

8 months ago

How to Autoplay and Loop YouTube Videos in WordPress

First Method: Use below code to play youtube video in loop and most important is…

1 year ago