Aleš Sýkora / November 28, 2023 / 0 comments

Speeding up WordPress & Toolset

Post summary: Tips for speeding up WP + Toolset.

Hello, I have some speeding up tips for your WordPress & Toolset website. Currently I found that GeneratePress Premium + Toolset + WP Rocket do a really great job.

I can easy go to 0.5sec on 1st load of page on shared webhosting running two WP sites with 1200 posts. It will be even better when the old site will be changed with new currently developed version.

  1. Disable Pagination scripts + CSS (if you do not use pagination) – BE CAREFUL ;)
  2. Remove loading of dashicons in frontend
  3. Remove WordPress RSD link
  4. Remove WordPress Shortlink
  5. Disable XML-RPC
  6. Disable generating of WP version in head
  7. Disable WLW manifest (static file, no speed up)
  8. Disable Pingbacks

Put these into custom code snippet in Toolset settings (do not create a garbage in functions.php):

// Disable Pagination script
function cleanup_scripts() {
 
    if ( !is_admin() ) {
 
        wp_dequeue_script( 'wpv-pagination' );
 
    }
}
add_action( 'wp_print_scripts', 'cleanup_scripts', 100 );

// Disable Pagination CSS
function cleanup_styles() {
 
    if ( !is_admin() ) {
 
        wp_dequeue_style( 'views-pagination-style' );
 
    }
}
add_action( 'wp_print_styles', 'cleanup_styles', 100 );

// Remove dashicons in frontend for unauthenticated users
add_action( 'wp_enqueue_scripts', 'bs_dequeue_dashicons' );
function bs_dequeue_dashicons() {
    if ( ! is_user_logged_in() ) {
        wp_deregister_style( 'dashicons' );
    }
}

// Remove RSD link
remove_action( 'wp_head', 'rsd_link' ) ;

//Remove WordPress shortlink
remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0);

// Remove XMLRPC
add_filter('xmlrpc_enabled', '__return_false');

// Hide WP version from head
remove_action( 'wp_head', 'wp_generator' ) ;

// Remove WLW manifest
remove_action( 'wp_head', 'wlwmanifest_link' ) ;

// Disable pingbacks
add_action( 'pre_ping', 'disable_pingback' );

Fuel my passion for writing with a beer🍺

Your support not only makes me drunk but also greatly motivates me to continue creating content that helps. Cheers to more discoveries and shared success. 🍻

0 comments

Share Your Thoughts