Programming

Simple trick to speed up your WordPress blog

I like WordPress a lot but the fact is that it is slower than serving static HTML pages. However, there is a very simple trick that can significantly speed up the loading of your wordpress blog. The tip is: “Reduce the number of unnecessary PHP calls”

This means replace the PHP calls in your wordpress theme with static HTML for things like blog title, content-type and the like. In the wordpress panel, go to the theme editor and open header.php

For example, change these lines

  1. <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
  2. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  3. <title><?php bloginfo(‘name’); ?> <?php if ( is_single() ) { ?> &amp;raquo; Blog Archive <?php } ?> <?php wp_title(); ?><?php bloginfo(‘description’); ?></title>

so they look something like this

  1. <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
  2. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  3. <title>Web Hosting Blog</title>