Optimize Your Website For Best Performance

After having tried and tested several themes & plugins, especially if it’s a CMS platform like WordPress, it’s likely that you’ll run into performance or memory load issues as your site continues to become more popular/get more visitors.

A friend of mine came to me with this issue recently where the heavy CPU usage by her site prompted her hosting provider to instate a temporary block on her database saying “The database was found to be consuming an inordinate amount of processor time, to the point of degrading overall system performance.”

Here are the steps I followed to fix the issues and get her website to perform much better. You too can follow these techniques to Optimize your Website For Best Performance.

1. Install W3 Total Cache

You MUST install a caching plugin and I recommend only one : W3 Total cache

W3 Total cache very effectively speeds up your site with several options and settings. It even helps you connect your site with a Content Delivery Network for better performance and security.

I also tried Wp Supercache which didn’t help reduce my database queries at all. Of course, there might be advanced options available but why try them when W3 Total cache works wonders right out of the box?

2. Disable Post Revisions

Post revisions can keep piling up in your database, making it bulky after a while. if you do not need to save these, add the following code to your site’s wp-config.php file.


3. Compression

Applying G-Zip or Z-Lib loss-less compression to compress your site files is the fastest way to speed it up. Just add the following code to your site’s header file right above the doctype declaration. You’ll see the change right away provided your hosting company supports this type of compression.

ini_set(’zlib.output_compression’, ‘On’);
ini_set(’zlib.output_compression_level’, ‘1′);

4. Delete Post Revisions and their Meta Data along with other unused clutter

Install the WP cleanfix plugin. This is a powerful plugin that runs a scan and generates a report listing all kinds of WordPress data that is unused/unattached, including images.

It also offers delete and optimize options for unused User meta, Post revisions, Auto drafts, Trash, Tags, Categories, Spam comments, Taxonomies and more in an easy to use options panel.

Getting rid of this data can really help optimize your site’s performance & overall user experience.

5. Delete database tables that are not in use

There are several useless tables left behind in your databse after you uninstall plugins/themes. These need to be cleared out. Install the WPDBSpringClean plugin that gives you a list of tables that are not in use and therefore safe to delete, along with a delete option so you don’t have to access your PHP My Admin.

6. Automatically Empty the Trash

You can instruct WordPress to empty trash after a desired number of days. Just add the following code in your site’s wp-config.php file:

define('EMPTY_TRASH_DAYS', 10 );

Where 10 is the number of days. You can change this interval to whatever you want.

7. See if Minify works for you

You can use Minify options in the W3 Total Cache settings panel or install WP-Minify plugin separately to combine and optimize javascript or css files. Use this plugin with caution however, because every time I have tried this, it has messed up the site’s front end. That does not have to be the case with your theme though. So give it a try!

After you’ve made all these changes, use the following tools to check how they have helped your site.

Port 80 Software: Here you can check how effectively G-Zip/ Z-Lib is working to compress your site.

P3 (Plugin Peformance Profiler): This plugin generates detail reports on how various plugins are affecting your website, how much memory your site is using etc.

Were these tips helpful? We’d love to hear from you. Do leave a comment below.