So, you’ve done the most you can with step one of your WordPress Diet.
Believe me, there are more sit-ups to come and more calories to burn.
Increasing your site speed isn’t about that guy in Montana who has dial-up (If you’re from Montana, please, accept my apology. Just pretend I said, “Wyoming.”)
It’s not even about providing a better experience for the user, although that is a worthwhile side-effect.
Speed is going to help with your Google ranking. Although it isn’t the only factor Google takes into consideration, it certainly carries enough weight to motivate you to put your WordPress on a diet. (Did you miss Step 1? Give it a read!)
1. Minify Your HTML & CSS
Minifying your site is about good organization. It will help you squeeze those extra kilobytes from your front end files and increasing your pages by milliseconds. All these tweaks and all of those milliseconds will add up in the end.
If you decided to use the W3 Total Cache as your caching plugin of choice, you have Minify settings built right in. Minify will strip out white space and comments from your HTML and CSS files and lowers the filesizes, thus, gives you faster load times.
For those not using W3 Total Cache, you can try this free online compression tool.
2. Image Compression
Sure, you can speed things up by compression the code, but what about all those images?
For those images that are related to our theme, make sure they’re as lean as can be. Don’t make your cache plugin do all the lifting. That defeats the purpose of good cache in the first place. It’s also a good idea to make sure you’re using the right graphic format:
- GIF is best when you’re dealing with just a few colors.
- JPEG is best for photos and multiple colors.
- PNG should be used for high quality transparent images.
When your theme calls for a 180px x 180px graphic, use a 180px x 180px graphic. Don’t use a 250px x 250px and scale your image with attributes.
After you’ve made your theme graphic files as lean as can be, run them through Smush.it. For all the other images uploaded through WordPress, try the WP Smush.it WordPress plugin to help optimize your images.
3. Disable Post Revisions
Post revisions can seriously bloat your database.
You can turn the feature completely off or limit the number of revisions.
To turn-off revisions completely, add this to your wp-config.php file:
[cc lang=”php”]define(‘WP_POST_REVISIONS’, false );[/cc]
I prefer setting a limit on the number of revisions. As before, add this to your wp-config.php file:
[cc lang=”php”]define(’WP_POST_REVISIONS’, 5);[/cc]
Of course, you will want to consider cleaning out all of those revisions that are currently sitting in your database.
Using the following SQL query, through phpmyadmin or similar (as always, create a backup before making such changes):
[cc lang=”php”]DELETE FROM wp_posts WHERE post_type = “revision”;[/cc]
These things (along with step one) should really help speed-up and make your WordPress much leaner than it was before.
Get started on your WordPress Diet, or go to step 3!
[via Line 25]
Eric J says
we’ve been saved by post revisions in the past so we’ll probably keep them on, is there a performance impact of having a large database?
Eric Dye says
Remember, you can limit the number of revisions. The best of both worlds? I’m not sure how WordPress stores revisions. Obviously, it effects large databases. I think I’ll look into that. I’m interested to know.