Title: Function register_rest_route problem
Last modified: August 19, 2023

---

# Function register_rest_route problem

 *  Resolved [christodeus](https://wordpress.org/support/users/christodeus/)
 * (@christodeus)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/function-register_rest_route-problem/)
 * Hi,
 * It’s seems that AI Engine is causing this error:
 * The register_rest_route function was called incorrectly. The namespace must not
   start or end with a slash. (This message was added in version 5.4.2.)
 * Any idea how to fix this?

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

 *  Plugin Author [Jordy Meow](https://wordpress.org/support/users/tigroumeow/)
 * (@tigroumeow)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/function-register_rest_route-problem/#post-16985541)
 * Hi,
 * Do you have the exact line for this error? Also, 100% sure it comes from AI Engine?
 *  Thread Starter [christodeus](https://wordpress.org/support/users/christodeus/)
 * (@christodeus)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/function-register_rest_route-problem/#post-16985721)
 * Hi,
 * Sorry I’m not 100% sure if it’s AI Engine, but I know that it happens when I 
   activate it and use it. I think maybe there is a disfunction with WooCommerce
   or another plugin, it happens when I activate Embedding only, here is the message
   from Query Monitor:
    1.  `register_rest_route()`
        wp-includes/rest-api.php:51
    2.  `MeowPro_MWAI_Embeddings->rest_api_init()`
        wp-content/plugins/ai-engine-pro/
        premium/embeddings.php:51
    3.  `do_action('rest_api_init')`
        wp-includes/plugin.php:517
    4.  `rest_get_server()`
        wp-includes/rest-api.php:587
    5.  `rest_do_request()`
        wp-includes/rest-api.php:545
    6.  `rest_preload_api_request()`
        wp-includes/rest-api.php:2911
    7.  `array_reduce()`
        wp-includes/rest-api.php:2911
    8.  `Automattic\W\I\A\Settings->add_component_settings()`
        wp-content/plugins/woocommerce/
        src/Internal/Admin/Settings.php:146
    9.  `apply_filters('woocommerce_admin_shared_settings')`
        wp-includes/plugin.php:
        205
    10. `Automattic\W\I\A\WCAdminSharedSettings->Automattic\W\I\A\{closure}()`
        wp-content/
        plugins/woocommerce/src/Internal/Admin/WCAdminSharedSettings.php:61
    11. `Automattic\W\B\A\AssetDataRegistry->execute_lazy_data()`
        wp-content/plugins/
        woocommerce/packages/woocommerce-blocks/src/Assets/AssetDataRegistry.php:267
    12. `Automattic\W\B\A\AssetDataRegistry->enqueue_asset_data()`
        wp-content/plugins/
        woocommerce/packages/woocommerce-blocks/src/Assets/AssetDataRegistry.php:368
    13. `do_action('admin_print_footer_scripts')`
        wp-includes/plugin.php:517
 *  -  This reply was modified 2 years, 9 months ago by [christodeus](https://wordpress.org/support/users/christodeus/).
 *  Thread Starter [christodeus](https://wordpress.org/support/users/christodeus/)
 * (@christodeus)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/function-register_rest_route-problem/#post-16985801)
 * Hi, It seems that it was Jetpack that was causing a problem, now I don’t have
   anymore error message
 *  Thread Starter [christodeus](https://wordpress.org/support/users/christodeus/)
 * (@christodeus)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/function-register_rest_route-problem/#post-16986510)
 * Hi, I talked to fast, the problem is still there:
    1.  `register_rest_route()`
        wp-includes/rest-api.php:51
    2.  `MeowPro_MWAI_Embeddings->rest_api_init()`
        wp-content/plugins/ai-engine-pro/
        premium/embeddings.php:51
    3.  `do_action('rest_api_init')`
        wp-includes/plugin.php:517
    4.  `rest_get_server()`
        wp-includes/rest-api.php:587
    5.  `rest_do_request()`
        wp-includes/rest-api.php:545
    6.  `rest_preload_api_request()`
        wp-includes/rest-api.php:2911
    7.  `array_reduce()`
        wp-includes/rest-api.php:2911
    8.  `Google\S\C\A\Assets->Google\S\C\A\{closure}()`
        wp-content/plugins/google-site-
        kit/includes/Core/Assets/Assets.php:398
    9.  `Google\S\C\A\Script_Data->Google\S\C\A\{closure}()`
        wp-content/plugins/google-
        site-kit/includes/Core/Assets/Script_Data.php:51
    10. `Google\S\C\A\Asset->before_print()`
        wp-content/plugins/google-site-kit/includes/
        Core/Assets/Asset.php:129
    11. `Google\S\C\A\Assets->run_before_print_callbacks()`
        wp-content/plugins/google-
        site-kit/includes/Core/Assets/Assets.php:1018
    12. `Google\S\C\A\Assets->run_before_print_callbacks()`
        wp-content/plugins/google-
        site-kit/includes/Core/Assets/Assets.php:1027
    13. `Google\S\C\A\Assets->run_before_print_callbacks()`
        wp-content/plugins/google-
        site-kit/includes/Core/Assets/Assets.php:1027
    14. `Google\S\C\A\Assets->run_before_print_callbacks()`
        wp-content/plugins/google-
        site-kit/includes/Core/Assets/Assets.php:1027
    15. `Google\S\C\A\Assets->Google\S\C\A\{closure}()`
        wp-content/plugins/google-site-
        kit/includes/Core/Assets/Assets.php:157
    16. `do_action('wp_print_scripts')`
        wp-includes/plugin.php:517
    17. `wp_print_head_scripts()`
        wp-includes/script-loader.php:2177
    18. `do_action('wp_head')`
        wp-includes/plugin.php:517
    19. `wp_head()`
        wp-includes/general-template.php:3053
    20. `load_template('wp-content/themes/my-listing/header.php')`
        wp-includes/template.
        php:785
    21. `locate_template()`
        wp-includes/template.php:720
    22. `get_header()`
        wp-includes/general-template.php:48
 *  Thread Starter [christodeus](https://wordpress.org/support/users/christodeus/)
 * (@christodeus)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/function-register_rest_route-problem/#post-16987206)
 * OK, so it was definitetly Google Site Kit which caused the errors. I have disabled
   it and now it works just fine. But so you know 🙂

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

The topic ‘Function register_rest_route problem’ is closed to new replies.

 * ![](https://ps.w.org/ai-engine/assets/icon-256x256.png?rev=3431928)
 * [AI Engine - The Chatbot, AI Framework & MCP for WordPress](https://wordpress.org/plugins/ai-engine/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ai-engine/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ai-engine/)
 * [Active Topics](https://wordpress.org/support/plugin/ai-engine/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ai-engine/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ai-engine/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [christodeus](https://wordpress.org/support/users/christodeus/)
 * Last activity: [2 years, 9 months ago](https://wordpress.org/support/topic/function-register_rest_route-problem/#post-16987206)
 * Status: resolved