Disable Posting To WordPress REST API

and like us on FB

This snippet prevents posting content to the WordPress REST API by validating that the method used is GET. It’s another example of how the WordPress rest_authentication_errors filter might be used.

See also: Disable The WordPress Rest API.