Wordpress - Is the Wordpress REST API installed and enabled in a vanilla Wordpress 4.7 installation?

4.7 has it enabled by default. The easy way to check if it is working is just to visit the example.com/wp-json url, and you should get a list of registered end points there

There is no official option to disable it as (at least there was a talk about it not sure if it got in the release), some core functionality depends on it.

The most obvious things to check for if it is not working is your htaccess rules, and do you have a wp-json directory


I had 4.7 also thought that REST API was disabled, but I was tricked by the URL. To see the correct URL seek a line looking something like that:

link rel='https://api.w.org/' href='http://mysite?rest_route=/' />. So, using http://mysite?rest_route=/ as the prefix solved my problem. For instance to recover the posts is enought to type: http://mysite?rest_route=/wp/json

I couldn't find on documentation that the query param was needed. Was I the only one?


If REST API isn't working out-of-box or after a fresh install and after typing in

mydomain/wp-json/wp/v2/posts 

then you would need to simply activate your "permalinks" as post_name located:

WP Dashboard->Settings->Permalinks

Or if you do not wish to activate permalinks, you can simply type:

mydomain?rest_route=/wp/v2/posts

Man, I wish WordPress would update their Rest handbook to be more user-friendly. I like the old version of docs :)

Tags:

Rest Api