Title: REST API ERRORS
Last modified: August 16, 2020

---

# REST API ERRORS

 *  [jasonsahli](https://wordpress.org/support/users/jasonsahli/)
 * (@jasonsahli)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/rest-api-errors/)
 * `Notice: register_rest_route was called incorrectly. The REST API route definition
   for nv/v1/posts/page/(?P\d+) is missing the required permission_callback argument.
   For REST API routes that are intended to be public, use __return_true as the 
   permission callback. Please see Debugging in WordPress for more information. (
   This message was added in version 5.5.0.) in /home/b8w1h184x61u/public_html/wp-
   includes/functions.php on line 5225`
 * Question: what causes this error? Is It due to latest WP update? Or something
   else?
 * plugins used: using elementor pro + yoast + woocommerce plugins
 * site: _[ redundant link removed ]_
    -  This topic was modified 5 years, 10 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).
    -  This topic was modified 5 years, 10 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Frest-api-errors%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Carike](https://wordpress.org/support/users/carike/)
 * (@carike)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/rest-api-errors/#post-13264571)
 * Hallo 🙂
 * The REST API is a way that your site makes information available to others via
   JSON (a machine-readable format).
    There are various default endpoints for the
   API. The API can also be extended.
 * That error message means that one of the REST API endpoints your site uses, isn’t
   doing a permissions check.
    This isn’t necessarily a security issue, but you 
   should check if the information displayed at the endpoint is supposed to be public.
 * Hope this helps.
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [5 years, 10 months ago](https://wordpress.org/support/topic/rest-api-errors/#post-13264591)
 * The error is coming from a plugin or theme which needs to be updated. Look through
   your plugins or themes for something that might be called “nv”.
 * In the meantime, this is a Notice only, so ask your host how to properly disable
   the “display_errors” setting in your PHP install.
 *  Thread Starter [jasonsahli](https://wordpress.org/support/users/jasonsahli/)
 * (@jasonsahli)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/rest-api-errors/#post-13264667)
 * My Friends: Thanks for the kind and helpful words. My nv theme (neve) is already
   running the running the latest version so still not sure how to correct this 
   other than to notify the theme provider of the issue and see if they can fix 
   it.
 *  [Carike](https://wordpress.org/support/users/carike/)
 * (@carike)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/rest-api-errors/#post-13264707)
 * Please notify the theme provider 🙂
    You can also refer them to the REST API 
   channel on Slack, if they are unsure. This error message was added specifically
   to help make sites more private (and in some cases, a lot safer). Again, this
   does not necessarily mean that there is a problem, as the information may need
   to be public, but it is something that the developer should check. If it is intended
   to be public, they should add __return_true to the function – that will remove
   the warning message.
 *  Thread Starter [jasonsahli](https://wordpress.org/support/users/jasonsahli/)
 * (@jasonsahli)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/rest-api-errors/#post-13264784)
 * I will follow this helpful advice and thank u for being good wp stewards for 
   help with this issue.
    -  This reply was modified 5 years, 10 months ago by [jasonsahli](https://wordpress.org/support/users/jasonsahli/).
 *  [Ari Stathopoulos](https://wordpress.org/support/users/aristath/)
 * (@aristath)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/rest-api-errors/#post-13266021)
 * [@jasonsahli](https://wordpress.org/support/users/jasonsahli/) The Neve theme
   has a class called `Pagination`. Inside that class, they have a method called`
   register_endpoints`. Inside the `Pagination->register_endpoints()` method they
   are calling the `register_rest_route` function, and in the arguments they pass
   to it they don’t include a `permission_callback` as the error you’re getting 
   mentions.
    Judging from their code, the callback they are performing doesn’t 
   get any private data so they can simply add this line in their arguments to make
   it work properly: `'permission_callback' => '__return_true',` So the end code
   on that method would look like this:
 *     ```
       public function register_endpoints() {
       	register_rest_route(
       		'nv/v1/posts',
       		'/page/(?P<page_number>\d+)/',
       		array(
       			'methods'             => \WP_REST_Server::CREATABLE,
       			'callback'            => array( $this, 'get_posts' ),
       			'permission_callback' => '__return_true'
       		)
       	);
       }
       ```
   
 * You can contact your theme theme-author with that information so they can fix
   it. 🙂
 *  [Alexei Suzdalenko](https://wordpress.org/support/users/alexeisuzdalenko/)
 * (@alexeisuzdalenko)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/rest-api-errors/#post-13842370)
 * thank you very much you helped me a lot

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘REST API ERRORS’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 5 participants
 * Last reply from: [Alexei Suzdalenko](https://wordpress.org/support/users/alexeisuzdalenko/)
 * Last activity: [5 years, 5 months ago](https://wordpress.org/support/topic/rest-api-errors/#post-13842370)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
