simple ways to optimise wordpress

No you don’t have to use w3tc or wp super cache. wordpress becomes slow when db queries grow. a quick way is to find the expensive queries and speed them up by caching them.

for example,

$sql = "select post_id from {$wpdb->prefix}postmeta where meta_key='_blar' and meta_value='$value'";

$id = wp_cache_get( 'id_'.$value );
if ( false === $id ) {
  $id = $wpdb->get_var($sql);
  wp_cache_set( 'id_'.$value, $id );
}

transient is also a fantastic way of caching – http://speckyboy.com/2011/12/14/website-speed-part-3-caching-wordpress/

Author: bpeh

Bernard Peh is a great passioner of web technologies and one of the co-founder of Sitecritic.net Website Design and Reviews. He works with experienced web designers and developers everyday, developing and designing commercial websites. He specialises mainly in SEO and PHP programming.