Business & Finance Advertising & sales & Marketing

5 Speed Tweaks for Your WordPress Website or Blog

The following are 5 tweaks to speed up your website or blog for WordPress users.
Shrink your images..
..
Here is a good free website that will do that for you is (imageoptimizer.
net) 2.
Use Expire Headers for your files & images, you can copy and paste this script below to your htaccess file: 1.
Shrink your images..
..
A good free website that will do that for you is (imageoptimizer.
net) 2.
Use Expire Headers for your files & images, you can copy and paste this script below to your htaccess file: # BEGIN Expire headers 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" # 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 [hide-this-part morelink="Show the rest"]made for your theme css and every plugins css file when your site is loaded, in my case that would be 40 calls/40 queries, you will have just one.
Compressing Javascript Go to plugin, click "edit" search for ".
js" ending files, copy or cut, the codes and paste them to (jscompress.
com), hit compress & paste your new shrunk code back & update.
Compressing CSS For plugins that have long & necessary CSS files(I will also get into this more below), follow the same steps ".
css" copy or cut, the codes and paste them into (csscompressor.
com), hit compress & paste your new shrunk code back & update.
4.
Use cache plugin, personally I have tried W3 Total Cache, WP Super Cache and Quick Cache.
I did find W3T Cache better then the more widely used Super Cache (me & my blog liked it better).
The only problem I had with W3T was the minify option was not working effectively so I switched to Quick Cache and found it to be the best out of the three because it plays nicer with multiple plugins.
My killer combo recommendation is Quick Cache & WP Minify.
Speaking of cache, adding cache control headers can also help, here is another script you can add to your htaccess file: # BEGIN Cache-Control Headers Header set Cache-Control "max-age=2592000, public" Header set Cache-Control "max-age=604800, public, must-revalidate" Header set Cache-Control "max-age=216000, private" Header set Cache-Control "max-age=600, private, must-revalidate" # 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 unnecessary 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 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 that usually they are more useless then the unnecessary CSS thrown into your web design, 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.

Leave a reply