5 WordPress Speed Tweaks
1. Shrink your images…. Here is a good free website that wil do that for you imageoptimizer

# BEGIN Expire headers <ifmodule mod_expires.c> ExpiresActive On ExpiresDefault "access plus 1 seconds" ExpiresByType image/x-icon "access plus 2592000 seconds" ExpiresByType image/jpeg "access plus 2592000 seconds" ExpiresByType image/png "access plus 2592000 seconds" ExpiresByType image/gif "access plus 2592000 seconds" ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds" ExpiresByType text/css "access plus 604800 seconds" ExpiresByType text/javascript "access plus 216000 seconds" ExpiresByType application/javascript "access plus 216000 seconds" ExpiresByType application/x-javascript "access plus 216000 seconds" ExpiresByType text/html "access plus 600 seconds" ExpiresByType application/xhtml+xml "access plus 600 seconds" </ifmodule> # END Expire headers
3. Minify & shrink your CSS and JavaScript. The Minify CSS portion is a bit easier then Javascript minify, simply copy your plugins CSS files to your theme css after you deregister the file(I will explain this below). What does this this do? Reduces HTTP requests, instead of having queries/requests


# BEGIN Cache-Control Headers <ifmodule mod_headers.c> <filesmatch ".(ico|jpe?g|png|gif|swf)$"> Header set Cache-Control "max-age=2592000, public" </filesmatch> <filesmatch ".(css)$"> Header set Cache-Control "max-age=604800, public, must-revalidate" </filesmatch> <filesmatch ".(js)$"> Header set Cache-Control "max-age=216000, private" </filesmatch> <filesmatch ".(x?html?|php)$"> Header set Cache-Control "max-age=600, private, must-revalidate" </filesmatch> </ifmodule> # END Cache-Control Headers
5. Last but not least, deregister your plugins scripts on your functions.php file. A lot, if not most plugins like to add unecessary css styles to your beautiful blog, so let’s go ahead and deregister them.
Step 1: Go to your plugins, click “EDIT” search (cntl +F) for this code in your plugins file, “wp_enqueue_style” and find the handler that is calling upon this plugin (the code next to “wp_enqueue_style” in (parenthesis)..
Example: I searched for “wp_enqueue_style” in a plugin called “please stop putting unnecessary scripts in plugins”
and I find this=
wp_enqueue_style( 'stop-putting-unnecessary-scripts-in-plugins-css' )
The handler here is = ‘stop-putting-unnecessary-scripts-in-plugins-css’
Step 2: So I copy all the codes in ‘stop-putting-unnecessary-scripts-in-plugins-css’ file and paste it to my theme’s CSS file (usually style.css). This is not always necessary, then I head over to my functions.php file, click edit & paste the following code.
Step 3:
add_action( 'wp_print_styles', 'my_deregister_styles', 100 );
function my_deregister_styles() {
wp_deregister_style( 'stop-putting-unnecessary-scripts-in-plugins-css' );
// deregister as many stylesheets as you need
}
Let’s just say I wanted to deregister 3 more css files from “please stop putting unnecessary scripts in plugins” plugin.
Find handler, you can copy the code to your theme’s CSS, not always needed & deregister it.
add_action( 'wp_print_styles', 'my_deregister_styles', 100 );
function my_deregister_styles() {
wp_deregister_style( 'stop-putting-unnecessary-scripts-in-plugins-css' );
wp_deregister_style( '1-no-purpose-css-codes-css' );
wp_deregister_style( '2-seriously-why-add-useless-css-codes-to-plugins-css' );
wp_deregister_style( '3-another-useless-code-css' );
}
Let’s move on to javascript. SAME EXACT THING EXCEPT WE ARE SEARCHING FOR “wp_enqueue_script”
Deregistering JavaScript can be more meaningful given they are usually more useless then the unnecessary CSS, but cause conflicts Jquery, which by the way is already built in to WordPress so it doesn’t need to be loaded once again. For fun purposes, let use “please stop putting unnecessary scripts in plugins” plugin.
This is what the deregister in functions look like:
function my_deregister_javascript() {
wp_deregister_script( ‘I-serve-no-purpose-js’ );
wp_deregister_script( ‘I-load-already-loaded-jquery-to-your-blog-js’ );
wp_deregister_script( ‘hi-im-jquery-conflict’ );
}
With CSS, deregister all after you copied the file to your theme CSS, with Javascript deregister 1 by 1 to test and see if your plugin has been affected by it, if you have any trouble with this Let me know because my plugin “please stop putting unnecessary scripts in plugins” is currently under development.
![]() | Author:Tony Porto Kansas City full-service web design studio. Web Developer & SEO enthusiast. |

