加速Wordpress

加速Wordpress

wp-config:

define('DISABLE_WP_CRON', true);
define('AUTOSAVE_INTERVAL', 300); // seconds
define( 'WP_POST_REVISIONS', 10 );

function.php

add_action( 'init', 'stop_heartbeat', 1 );
function stop_heartbeat() {
wp_deregister_script('heartbeat');
}

10. Disable XML-RPC
If you don’t use mobile devices to publish content (or plugins like JetPack), you should disable XML-RPC not only for CPU reasons, but it also stops brute force + DDoS attacks. To disable it, paste the code in .htaccess and replace xxx.xxx.xxx.xxx with your IP address in case you need it. Alternatively, you can disable XML-RPC in Perfmatters or by using the Disable XML-RPC plugin.

# Block WordPress xmlrpc.php requests

order deny,allow
deny from all
allow from xxx.xxx.xxx.xxx

分享这篇文章