Ghi chú cách gỡ vài lỗi liên quan đến tiến trình cập nhật WordPress.

1. “Briefly unavailable for scheduled maintenance. Check back in a minute” trên trang frontend

Dùng File Manager trực tiếp trên hosting hoặc ứng dụng FTP client như FileZilla, Cyberduck…, tìm và xóa file .maintenance trong thư mục chứa mã nguồn.

2. “Another update is currently in progress” trên trang admin

Dùng phpMyAdmin truy cập vào database, tìm và xóa record core_updater.lock trong tabale wp-options.

3. Để tránh WordPress tự cập nhật và gặp lỗi bất thình lình, ta có thể khai báo trong file wp-config như sau:

define( 'WP_AUTO_UPDATE_CORE', false );
define( 'AUTOMATIC_UPDATER_DISABLED', true );

Ngoài ra, WordPress cũng hỗ trợ hooks để bật/tắt cập nhật tự động.

// Disable core updates
add_filter( 'auto_update_core', '__return_false' );
// Disable automatic updates for All plugins:
add_filter( 'auto_update_plugin', '__return_false' );
// Disable automatic updates for All themes:
add_filter( 'auto_update_theme', '__return_false' );
// Disable translation file updates
add_filter( 'auto_update_translation', '__return_false' );

P/S Bài viết là kinh nghiệm chủ quan hạn hẹp của tác giả nên có thể sẽ không áp dụng được trong các trường hợp riêng biệt. Dĩ nhiên, trong cuộc sống có nhiều cách giải quyết vấn đề khác nhau, nếu bạn có cách làm hay hơn, xin hãy chia sẽ!