Snip the superflous. Free themes are designed to be as easy to install as possible. You simply upload your theme, activate it, and you’re done. It knows your blog’s name, description, feed URL and everything else.

In order to know all of this, the theme uses PHP tags to get the information. However, it has to use these tags every time a page is loaded.

As most of the information never changes, you can delete these tags from your theme, and replace them with normal text. That way, your server has less to process next time around.

13 Common Tags in WordPress Themes

The easiest way to replace the tags is to load up a page from your blog, then “View Source.” Now go through your theme and look for the following tags, then find what each tag corresponds to in your page source. Paste the text from the page source over the theme tags.

Save the files after every change and check that the new version of the page is identical to the old.

  1. <?php language_attributes(); ?> found in header.php.
  2. <?php bloginfo(‘html_type’); ?> found in header.php.
  3. <?php bloginfo(‘charset’); ?> found in header.php.
  4. <?php bloginfo(‘name’); ?> found throughout the theme.
  5. <meta name=”generator” content=”WordPress <?php bloginfo(‘version’); ?>” /> <!– leave this for stats –> found in header.php. If you’re using a 3rd party stats program (like Google Analytics) then you’ve nothing to worry about, and if your version of WordPress is out of date, you won’t want hackers knowing that.
  6. <?php bloginfo(‘stylesheet_url’); ?> found in header.php.
  7. <?php bloginfo(‘rss2_url’); ?> founder in header.php, sidebar.php and footer.php. Be careful if you switch to FeedBurner after doing this. Make sure you remember to update the feed URL here manually (The FeedSmith plugin won’t do it anymore).
  8. <?php bloginfo(‘pingback_url’); ?> found in header.php.
  9. <?php bloginfo(‘stylesheet_directory’); ?> found throughout the theme.
  10. <?php bloginfo(‘description’); ?> found throughout the theme. Your site’s slogan.
  11. <?php bloginfo(‘comments_rss2_url’); ?> found in sidebar.php and footer.php.
  12. <!– <?php echo get_num_queries(); ?> queries. <?php timer_stop(1); ?> seconds. –> found in footer.php. This HTML comment won’t be overly useful to many of us, so delete away!
  13. If you are using widgets, you can also delete the code in sidebar.php between the lines<?php /* Widgetized sidebar, if you have the plugin installed. */
    if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar() ) : ?>

    and
    <?php endif; ?>
    Content between these 2 lines is only used if widgets are not enabled. If you know that you will continue to use widgets, then there is no need for any code here (It may be worth leaving a comment along the lines of “Content here used if widgets are disabled” to remind yourself of this in the future).

By removing these, you’ll shave the load of your server and pages will be constructed that bit faster.

Enjoy this post? You should follow me on Twitter!