Skip to content

Instantly share code, notes, and snippets.

@pixelbart
Created January 10, 2017 11:41
Show Gist options
  • Save pixelbart/e694cc71ad0b6e8ba32ac28233a97c13 to your computer and use it in GitHub Desktop.
Save pixelbart/e694cc71ad0b6e8ba32ac28233a97c13 to your computer and use it in GitHub Desktop.
Add this in your functions.php and optimize some simple things
<?php
/**
* WordPress Optimizing
*/
// Remove Query String from Static Resources
function remove_cssjs_ver( $src ) {
if( strpos( $src, '?ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );
// Remove other unwanted scripts
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment