Blog

Fix the error No route was found matching the URL and request method

Hamid Nataj

February 20, 2025

11:17 pm

No answer

In this short tutorial, we will teach you a way to easily fix the error No route was found matching the URL and request method in Elementor. This error has various causes, but it is recommended to use this method for a temporary fix. If the problem and the reasons given below are resolved, reconnect.

Due to many questions about how to use this tutorial in the comments, we have prepared this tutorial for you in the form of a video

Video viewer

00:00

01:24

According to the video, if you are using the Hello Elementor theme, click to install the Hello Elementor child theme
Reasons for the No route was found matching the URL and request method error
This error is one of the Elementor errors and has various causes, and the problem is that it cannot connect to its main server. List of possible factors:

Banning and filtering
Inactive REST API
Plugin conflict
Incompatible version of Elementor or WordPress
Problems with permalinks
Hosting restrictions
Firewall or server security settings
Template conflict
Problems with SSL settings
Error in the .htaccess file
Incompatible PHP version
Fixing the No route was found matching the URL and request method error
To fix this problem, place the code below in your template’s functions.php (as shown in the image below) )

To do this, go to Dashboard > Appearance > Shell File Editor.

// Prevent Elementor from connecting to my.elementor.com
add_filter(‘elementor/connect/additional-connect-info’, ‘__return_empty_array’);
add_filter(‘elementor/connect/connect-url’, ‘__return_empty_string’);
add_filter(‘elementor/connect/remote-info-data’, ‘__return_empty_array’);

// Handle base-app.php errors by providing default values
add_filter(‘elementor/connect/apps/get_client_data’, function($client_data) {
if (is_wp_error($client_data)) {
return [
‘client_id’ => ”,
‘auth_secret’ => ”,
‘redirect_uri’ => ”,
‘callback’ => ”,
‘admin_notice’ => ”,
];
}
return $client_data;
}, 10, 1);

// Completely block connection attempts without throwing an error
add_filter(‘pre_http_request’, function($pre, $parsed_args, $url) {
if (strpos($url, ‘my.elementor.com’) !== false) {

return [
‘body’ => ”,
‘response’ => [
‘code’ => 200,
],
‘headers’ => [],
‘cookies’ => [],
];
}
return $pre;
}, 10, 3);

// Disable the Elementor binding library
add_action(‘elementor/init’, function() {
if (class_exists(‘\Elementor\Core\Common\Modules\Connect\Module’)) {
remove_action(‘elementor/editor/before_enqueue_scripts’, [
\Elementor\Core\Common\Modules\Connect\Module::class,
‘enqueue_connect_scripts’
]);
}
});

add_action(‘admin_menu’, function() {
remove_submenu_page(‘elementor’, ‘elementor-connect’);
}, 99);
add_filter(‘elementor/api/get_templates/body_args’, ‘__return_empty_array’);
add_filter(‘elementor/api/get_info_data’, ‘__return_empty_array’);
add_action(‘init’, function() {
remove_action(‘admin_notices’, [\Elementor\Core\Common\Modules\Connect\Module::class, ‘admin_notice’]);
});

Leave a Reply

Your email address will not be published. Required fields are marked *