Skip to content

Instantly share code, notes, and snippets.

@vutruso
Last active July 7, 2023 06:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vutruso/c768d520c825dd6beca2207b5aa7f39e to your computer and use it in GitHub Desktop.
Save vutruso/c768d520c825dd6beca2207b5aa7f39e to your computer and use it in GitHub Desktop.
Tinh chỉnh và tối ưu wp-config WordPress
# https://vutruso.com/wp-config/
# Thay doi url website
define('WP_HOME','https://vutruso.vn/');
define('WP_SITEURL','https://vutruso.vn/');
# Tang thoi gian tu dong luu moi 120 giay
define( 'AUTOSAVE_INTERVAL', 120 );
# Gioi han save revisions, chi de 8 bang
define( 'WP_POST_REVISIONS', 8 );
# Bat buoc ket noi HTTPS
define('FORCE_SSL_LOGIN', true);
define('FORCE_SSL_ADMIN', true);
# Tat tinh nang chinh sua theme/plugin
define( 'DISALLOW_FILE_EDIT', true );
# Vo hieu hoa tinh nang update theme/plugin
define( 'DISALLOW_FILE_MODS', true );
# Tang bo nho gioi han cho PHP
define( 'WP_MEMORY_LIMIT', '128M' );
# Sua loi wp
define( 'WP_ALLOW_REPAIR', true );
# Xoa bai trong thung rac sau 7 ngay
define( 'EMPTY_TRASH_DAYS', 7 );
// Chặn toàn bộ API CALL
define( 'WP_HTTP_BLOCK_EXTERNAL', true );
// Cho phép request từ wordpress.org hoặc 1 tên miền nào đó bạn muốn
define( 'WP_ACCESSIBLE_HOSTS', '*.wordpress.org, vutruso.com' );
# Enable debug
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true);
define( 'WP_DEBUG_DISPLAY', true);
define( 'SAVEQUERIES', true);
# Tu dong cap nhat WordPress
define('WP_AUTO_UPDATE_CORE', true);
# Tat tu dong update WordPress
define( 'WP_AUTO_UPDATE_CORE', false );
# Thay doi vi tri file wp-config.php
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
require_once(ABSPATH . '../thu-muc-tuy-chinh/wp-config.php');
# Redis Cache
define('WP_REDIS_SCHEME', 'unix');
define('WP_REDIS_PATH', '/home/vozbqrlr/redis/redis.sock');
define('WP_REDIS_CLIENT', 'pecl');
define('WP_CACHE_KEY_SALT', 'vutruso.vn');
# tắt WP-Cron
define( 'DISABLE_WP_CRON', true );
# WP Cron không chạy quá 60 lan moi giay
define( 'WP_CRON_LOCK_TIMEOUT', 60 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment