Remove WordPress Unnecessary PHP Queries and Database Access
Almost all wordpress themes are made in such a way that there is minimal user effort in configuring them. These themes come with some generic php codes, which can be easily replaced after we install it in our blog.

Before starting with anything, first take a complete backup of your theme files.
Now go to http://tools.pingdom.com and enter your site url and do a speed test to see how long does it take for your website to load. Our aim is to reduce the load time and server load to a much lesser value.
Common PHP Queries in WordPress Themes
The easiest way to replace the php queries is to load up a page from your blog, for ex. in chrome and press Ctrl + U or select View Source From the menu. Now go through your theme and look for the following php queries, then find what each php query corresponds to in your page source. Paste the text from the page source over the theme’s php query.
After every change check that the new version of the page is identical to the old.
<?php language_attributes(); ?> found in header.php
<?php bloginfo('html_type'); ?> found in header.php
<?php bloginfo('charset'); ?> found in header.php
<?php bloginfo('version'); ?> found in header.php
<?php bloginfo('stylesheet_url'); ?> found in header.php
<?php bloginfo('name'); ?> found throughout the theme
<?php bloginfo('description');?> found in header.php
<?php bloginfo('template_url'); ?> found in header.php
<?php bloginfo('rss_url'); ?> found in header.php and sidebar.php
<?php bloginfo('pingback_url'); ?> found in header.php
<?php bloginfo('comments_rss2_url'); ?> found in sidebar.php and footer.php
Also check your sidebar.php and footer.php for stuff like
<?php _e("Categories"); ?>
<?php _e("Pages"); ?>
<?php _e("Tags"); ?>
<?php _e("Meta"); ?>
and replace them.
Taking a look at your themes files and making the necessary changes won’t take you more than 30 minutes and replacing these avoidable php queries will lessen your server load and also make your site faster.



