آموزش رفع خطای No route was found matching the URL and request method
در این نوشته به روش رفع خطای No route was found matching the URL and request method می پردازیم. این خطا زمانی رخ میدهد که المنتور پرو داشته باشید.
آموزش رفع خطای No route was found matching the URL and request method
این خطا زمانی معمولا در مواردی نظیر تحریم، غیرفعال بودن REST API، تداخل افزونههای دیگر با المنتور، مشکلات در پیوندهای یکتای سایت، محدودیتهای هاستینگ سایت وردپرسی شما، فایروال یا تنظیمات امنیتی سرور وبسایت شما، تداخل قالب فعال سایت وردپرسی شما، مشکلات در تنظیمات SSL سایت، خطا در فایل htaccess یا ناسازگاری نسخهی PHP هاست یا سرور شما.
این خطا به شکل زیر نمایش داده میشود:
برای رفع این مشکل فایل functions.php قالب فعال سایت وردپرس خود را باز کنید و قطعه کد زیر را درون آن قرار دهید:
// 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 errors in base-app.php 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 prevent connection attempts without displaying 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 Elementor Connection 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']); });
پس از ذخیره قطعه کد بالا به ادامهی کار خود برسید مشکل شما حل شده است.
پایان!
اگر سوالات بیشتری در ارتباط با المنتور دارید در بخش نظرات این نوشته برای ما بنویسید.
ارسال پاسخ