Tắt thông báo lỗi trên WordPress

Đôi khi việc WordPress của bạn vẫn thông báo lỗi mặc dù đã tắt chế độ debug của wordpress.

Ví dụ như lỗi warning xuất hiện khi bạn cập nhật phiên bản php mới mà wordpress là phiên bản cũ và không hỗ trợ cho phiên bản php này (Phiên bản wordpress 4.9 nhưng lại chạy php 7.x).

Warning</span>: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"

Bạn thêm đoạn mã sau vào trong file wp-config để tắt toàn bộ thông báo lỗi.

ini_set('display_errors','Off');
ini_set('error_reporting', E_ALL );
define('WP_DEBUG', false);
define('WP_DEBUG_DISPLAY', false);

Leave a Reply