Enable Post Comments

Open your WordPress theme’s functions.php, and add the following snippet:

add_filter( 'rest_allow_anonymous_comments', '__return_true' );

If you skip this step and try to post a comment using the REST API, you will get a 401: Sorry, you must be logged in to comment. error.

Last updated