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

I’ve just installed WordPress 4.7. One of the mentions in the announcement is that it features a REST API.

My understanding is:

  • The WordPress REST API plugin is not needed anymore, because supposely it has already been merged with core in WordPress 4.7.
  • The WordPress REST API is enabled by default

However, I notice that in a vanilla WordPress 4.7 install, none of the endpoints seems to work (for example http://examples.com/wp-json/wp/v2/posts).

How can I tell if the new REST API is really activated? Can the REST API be enabled or disabled with the vanilla WordPress UI, or should I install a third party plugin to do so?

4

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

Also, if /wp-json/wp/v2/posts type URLs don’t work for you, but /?rest_route=/wp-json/wp/v2/posts does, it means you need to enable pretty permalinks in the settings (suggested by Giles Butler in comments below).

Leave a Comment