skip to Main Content

The site I’m working on is showing this issue on the posts/pages on the dashboard.

"Notice: register_rest_route was called incorrectly. The REST API route definition for yoast/v1/get_head is missing the required permission_callback argument. For REST API routes that are intended to be public, use __return_true as the permission callback. "

I just updated to WP 5.7.2 and the Yoast SEO Premium is version 14.4.1.

Does anyone know how to address this?

2

Answers


  1. The permission_callback is required since WordPress 5.5, maybe if you update Yoast SEO the issue can get fixed, and if you can’t update, I’ll recommend disabling the WP_DEBUG from your wp-config.php file like this: define('WP_DEBUG', false)

    See REST API changes in WordPress 5.5 – section ‘permission_callback’

    Login or Signup to reply.
  2. Add ‘permission_callback’ => ‘__return_true’ as argument to the function. Below are example code you can follow

    register_rest_route( 'plugin_name/api', '/token/', array(
        'methods' => 'YOUR_METHOD',
        'callback' => 'CALLBACK_FUNCTION_NAME',
        'permission_callback' => '__return_true',
    ));
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search