Optimise WordPress

Below is quick methods using that we can optimise wordpress:

Need to add this code top of the header.php file

<?php function callback($buffer)
{
$buffer = str_replace(“type=’text/javascript'”, “”, $buffer);
$buffer = str_replace(‘type=”text/javascript”‘, ”, $buffer);
$buffer = str_replace(“type=’text/css'”, “”, $buffer);
return ($buffer);
}

ob_start(“callback”); ?>

Add at the bottom of footer.php file <?php ob_end_flush(); ?>

optimise wordpress

Remove emoj icons from wordpress
function disable_wp_emojicons() {

remove_action( ‘admin_print_styles’, ‘print_emoji_styles’ );
remove_action( ‘wp_head’, ‘print_emoji_detection_script’, 7 );
remove_action( ‘admin_print_scripts’, ‘print_emoji_detection_script’ );
remove_action( ‘wp_print_styles’, ‘print_emoji_styles’ );
remove_filter( ‘wp_mail’, ‘wp_staticize_emoji_for_email’ );
remove_filter( ‘the_content_feed’, ‘wp_staticize_emoji’ );
remove_filter( ‘comment_text_rss’, ‘wp_staticize_emoji’ );

//Remove filter TinyMCE emojis
add_filter( ‘tiny_mce_plugins’, ‘disable_emojicons_tinymce’ );
}

add_action( ‘init’, ‘disable_wp_emojicons’ );

function disable_emojicons_tinymce( $plugins ) {
if ( is_array( $plugins ) ) {
return array_diff( $plugins, array( ‘wpemoji’ ) );
} else {
return array();
}
}

1. Update new version of WP
2. Add images on CDN
3. optimise CSS, HTML, JS, DB
4. Optimise and cache all pages
5. Improve site performance and speed.
6. Will remove unnecessary JS and CSS and WP functions for optimisation
7. server beverage
8. Clean up your code wp-config file setting

define( 'WP_POST_REVISIONS', 3 );

Enable Multisite / Network Ability

define( 'WP_ALLOW_MULTISITE', true );

Redirect Nonexistent Blogs

define( 'NOBLOGREDIRECT', 'http://example.com' );

Debug

define( 'WP_DEBUG', true );
define( 'SCRIPT_DEBUG', true );

Leave a Reply

Your email address will not be published. Required fields are marked *