WordPress has become widely used blog and CMS platform in recent years. However, with it’s functionalities and new capabilities users need to cope with less performance, bigger server resources and increased page-load times. However, we can make something to make the situation better and I will introduce you to many WordPress optimization tricks and tips varying from using less plugins to database and server optimization.
SEO-friendly urls usage and structure
If you WordPress system uses lots of server resources including so important RAM, you should check if your seo-friendly urls are not made of /category/post-title/. This kind of configuration uses the most server resources because every time you load some page, the script has to go trough all the database table to find the right post title. The best solution for this is to make your urls more friendly for performance by including some date.
For example, you will have less problems if your urls had been with a year and a month: 2011/02/post-title. You can adapt everything for your needs, but the secret is that now script needs to look only at the fields near 2011 and 02 for the right page.
WordPress plugins number and usage
Furthermore, not only the quantity of used plugins is bad, but the plugins themselves. As WordPress became very popular lots of amateur programmers create plugins and those plugins usually are not created with performance in mind. In my practice I had some really bad experiences, for example, when simple plugin makes your website go down without explanation and so on.
However, you should consider using WP Super Cache plugin which might help you incredibly fasten your website load times. But I warn you in advance, that you need to be careful with its settings. For example, do not forget to clear the cache after changes to your theme or code otherwise you might think that something is not working.
For example, you do not need to install a WordPress plugin if you need to add some Twitter and Facebook buttons. All that you need is to add a simple function to your template’s functions.php file. Here’s a code for that:
Compressing images and files, using sprites and lazy load
Yahoo Smush.it helps you compress images. You can even download a special plugin for WordPress that will help you do this automatically. This plugin can also smush hosted images if you want to take care of your previous posts.
There are lots of tools for compressing CSS too and couple of them has advanced settings too, for example, to compress color codes and other fancy stuff. Try MinifyCSS with many advanced setting or a much simpler CSS Compressor. Play with settings and choose the best that fits your needs.
After you successfully optimized your images and files you should think of using CSS Sprites. If you are not familiar with this great technique visit SmashingMagazine article and you will know everything about creating and using CSS sprites.
Flash advertisement is a great way to gather more clicks and visual experience, however this makes your website load time longer too. I suggest to review all the advertisement in your website and get rid of any advertisement that has bigger impact on your websites performance. I am not talking about Google AdSense or similar alternatives, they are usually optimized and the right option for you to make some money from your content. But do not overdo with flashy and fancy advertisement.
WordPress database optimization tips
WordPress uses MySQL database and as more advanced programmers know MySQL is not the fastest tool out there, however it’s good for daily websites needs and there are some simple tips to make them better.
For example, you can optimize your database tables without any additional plugins. You just need to login to your phpMyAdmin and check tables having overhead and optimize them. MySQL tables have overhead when you delete data and it holds the spaces of deleted data for future use, so when you insert something new it uses the overhead, but if you constantly and heavily delete information, for example spam comments, the overhead might be big enough. You will find ability to select overhead tables and optimize them below all the tables list, see a screenshot.
In addition, you can set your trash can to be erased more often. You need to one more line to your wp-config.php file:
define( ‘EMPTY_TRASH_DAYS’, 5);
This means that your trash can will be deleted every 5 days.
You can also cache your database table by using DB Cache Reloaded plugin. It caches your database queries for specified lifetime. Another great alternative for caching your database is WPDBManager. Moreover, with this plugin wou will be able to create backup copies of your database.
Special WordPress hosting
You might also try and like special hosting providers who configures their servers for best WordPress experience and load times. Moreover, prices are quite normal and does not differ much from casual hosting provider. But keep in mind that your hosting provider makes a big impact to your whole system performance too and you should not believe that a cheap hosting provider is your best choice.
To sum up
WordPress is a great system for your blog or CMS, but you need to take care of it after some time because users and yourself sometimes make bad decision and there’s no surprise when you find out that too many plugins, big images and bad url structure make your website slower than snail.