10 Basic Tips for Improving Your WordPress Website

A lot of people use WordPress as their blogging platform. After installing WordPress, newly christened WordPress users will usually try to find and download WordPress themes that they can use so that their site looks different from the default theme. Whether a WordPress theme is free or premium, there are plenty of ways to improve them. The following WordPress theme tips cover basic customization, styling and optimization.


1. Reduce the Size of Theme Images

Images are an important part of every WordPress theme, yet WordPress theme developers sometimes forget about optimizing them. Images in a WordPress theme include CSS background images, template logos, default stock images, icons, and so on.

Optimizing images can save you in bandwidth consumption and can improve page response times for your blog readers.

Photoshop, for example, offers a Save for Web feature that optimizes images for the web. What I usually do is lower the quality settings of the image until I start to see changes in color or quality.

Furthermore, you can use a lossless image optimization tool like Smush.it that will squeeze out excess file size without loss in image quality. You can find more image optimization tools here.

Reduce the Size of Theme Images


2. Use a Custom Favicon

Some WordPress themes don’t come with a default favicon (the icon that represents a website that you can see in browser tabs and browser web address bars).

Add a Favicon

A favicon can be easily created using any graphic program that will allow saving of .ico graphic files, such as The GIMP. There are also online services that will allow you to create a favicon for free.

The image should be clear and is usually designed to match your blog image and/or content, a big task for something so small.

To prepare the image to be saved as favicon.ico:

  1. By cropping or adding space around the image, make the image square.
  2. Resize the image to 16 x 16 pixels.
  3. Save the file as favicon.ico.

If using an online service to create your favicon, such as Faviconer.com (creates 24bit favicon.ico with a transparent background) andfavicon.co.uk or Dynamic Drive, follow the instructions provided by the site. Then download the image of the favicon.ico to your computer.

When a website doesn’t have a favicon, it can look unprofessional. Make sure that your WordPress theme has a favicon. You can check out this list of favicon generators to help you design your own.

To reference your WordPress icon, simply place the following code inside header.php, which can be found inside your theme’s directory:

Modify the href attribute value to point to the location of your favicon file.


3. Style WordPress Image Captions

When you upload and post an image in a blog post, you can give them image captions to describe it.

Every good WordPress theme should include default styles for image captions. To style the default caption, you can use the .wp-caption class in your styles.css.

Here is an example of styling the image caption (using some CSS3 properties):

.wp-caption {
  background-color: #f3f3f3;
  border: 1px solid #ddd;
  -khtml-border-radius: 3px;
  -moz-border-radius: 3px;
  -webkit-border-radius: 3px;
  border-radius: 3px; /* optional rounded corners for browsers that support it */
  margin: 10px;
  padding-top: 4px;
  text-align: center;
}
.wp-caption img {
  border: 0 none;
  margin: 0;
  padding: 0;
}
.wp-caption p.wp-caption-text {
  font-size: 11px;
  line-height: 17px;
  margin: 0;
  padding: 0 4px 5px;
}

Here is the result of the style rules above:

Style WordPress Image Captions


4. Use PHP Flush

By calling the PHP flush function right after your header, you will be able to speed up your WordPress blog. Simply add this line of code below to your header.php file after the closing </head>

This code simply forces your web server to send your website’s header before sending the rest of the content. By using the flush function, the browser has time to download all the stylesheets referenced in the header while waiting for the other parts of the web page.


5. Use Shorthand CSS in Your Theme’s Stylesheet

The CSS files of WordPress themes contain lots and lots of code to cover all sorts of situations and usage. In order to reduce the size of the file, you can use shorthand CSS. Some WordPress theme designers will make it easier for less advanced users to tweak the styles by not using shorthand properties, but if you’re an experienced CSS coder, you can write/re-write the styles using shorthand properties.

For example, if you find style rules in your theme that look like this:

.post {
  padding-top:3px;
  padding-right:10px;
  padding-bottom:5px;
  padding-left:2px;
}

You could reduce them to their shorthand equivalent as such:

.post { padding: 3px 10px 5px 2px; }

This will effectively reduce the size of your stylesheet. Changing this won’t make that much of a difference, but every bit of optimization brings you a little closer to a faster WordPress theme.


6. Minify Your WordPress Theme Files

Congruent with using shorthand properties for CSS to optimize styles.css, if your theme’s CSS and JavaScript files aren’t minified, you can minify them to reduce their file sizes. Minification will take out unneeded characters from your files such as spaces and tabs.

For JavaScript, you can use JavaScript Compressor, a free web-based tool that you can use to minify your JavaScript files.

For CSS, check out this list of CSS optimizers.

It will be trickier to minify your HTML since the theme’s markup is spread amongst several files and they will have PHP code interspersed with them. However, there are plugins like W3 Total Cache that will minify all of your front-end code as well as perform other optimization processes such as caching your blog posts to improve site speed.


7. Secure the Theme

Remove WP Version Information – WordPress generally gives away the version number of your installation at 2 places – in the site’s header and the footer(if the theme displays it). If you are using a older version of WordPress, you should remove it lest it gives hackers information that you are using outdated version which may have some security loopholes in it for them to exploit.Removing information from the footer is easy…just find the php code below in your footer.php and delete it.

For removing it from your header, it requires you to edit the theme’s functions.php file since it is displayed automatically in header by wp_head() function call from header.php file. Add this line to your theme’s function.php just before the last ?> :

remove_action( 'wp_head', 'wp_generator' );

Above method of editing functions.php works only in WordPress 2.5 and above. For wordpress versions below, it remove this code from theme’s header.php file:

This code may appear in your themes if you are using them in WordPress 2.5 or above, as some theme authors may not have removed this.


8. Hide Dashboard Login Errors

Another way to protect your WordPress theme is to hide login errors. The reason is that whenever you are trying to login using the correct username but with the wrong password, a message will show up saying “Error: Incorrect Password.” You’ve now given a clue that the username entered is in the system, and that they simply need to crack its password.

Hide Dashboard Login Errors

Similarly, whenever you enter an unavailable username, a message appears stating “Error: Invalid username”. This of course reveals that the username is non-existent and becomes one less permutation that needs to be checked.

In order to keep this from happening, you need to add this code to your functions.php file:

add_filter('login_errors', create_function('$a', "return null;"));

This filter will remove the standard WordPress error by displaying nothing when a login is incorrect.


9. Replace the Theme’s Search Feature

Most themes you download will use the default search function in WordPress core, specifically because it is a best practice recommended by WordPress core developers for developing and distributing WordPress themes.

However, the core search function, at the moment, is not as robust and accurate as a third-party search service such as Google Custom Search, Yahoo! Search BOSS, or the Bing API. For example, in the WordPress core search function, typing a blog post author’s name will not yield a result (unless you include it in your posts as a custom field).

Replace the Theme's Search Feature with Google Custom Search

On the other hand, using web services provided by Google, Yahoo!, and Microsoft’s Bing will not only take advantage of their expertise in search, but can also help reduce your server load for searches.

For integrating Google Custom Search to your WordPress theme, check out the Google Custom Search Plugin or this tutorial called Integrate Google Search on your WordPress blog.

For Yahoo! Search BOSS, see the Yahoo BOSS WordPress plugin or this tutorial entitled Create a Yahoo BOSS powered Site Search Engine.

Finally, if you’re interested in the Bing API (which is being currently used for one of the largest WordPress blogs in the world, Mashable), have a look at this tutorial named Bing Search API wrapper for PHP.


10. Reduce Function Calls and Hooks for Static Content

Theme files for mass consumption and use under diverse situations need to be flexible. As such, there are plenty of dynamic function calls and hooks to make the theme work in multiple ways and situations.

However, this can lead to lower performance and page speeds because every time a page is generated, it needs to make multiple function calls to render the page.

Look out for things that don’t need to be function calls; pay attention to things that are unlikely to change.

For example, in header.php, you might find a line that looks like this:

<?php bloginfo('name'); ??>

This line prints out your blog’s name in the browser’s title bar. Your blog’s name probably won’t change often, if at all, so you could reduce a needed function call by replacing it with your blog name, like so:

Your Blog Name

Here’s another example (again, usually found in header.php):

The above example references the URL of your stylesheet. However, it’s unlikely this URL will change, so you can just directly write the URL like so:

There are plenty of these function calls for non-custom WordPress themes, and collectively, they can contribute to the sluggishness of your WordPress blog, especially when you aren’t using a caching plugin.

Previous WordPress For Dummies [E-Book] - FREE Download
Next 102 Proven Attention Grabbing Headlines Headline Formulas

About author

Jarrett Gucci
Jarrett Gucci 289 posts

Jarrett Gucci is the owner of Dynasty Web Solutions. A full service Internet presence provider specializing in WordPress development for business owners. Jarrett Gucci along with his team of professionals have designed over 400 WordPress websites. Jarrett Gucci believes strongly in creating websites that are unique, functional and generate referrals.

You might also like

WordPress Resources 0 Comments

What is the HOST to BOAST about – Selecting a good hosting company.

It’s the never ending question of which hosting company is the best for your website.  I can’t tall you how many discussions I have been involved in on this topic. 

WordPress Resources 0 Comments

WordPress Maintenance Packages

The WordPress Maintenance packages are monthly plans that we offer to take all the stress off your shoulders for managing the technical side of your business. Plus, you will get

WordPress Resources 0 Comments

WordPress For Dummies [E-Book] – FREE Download

Bloggers love WordPress! If you’re ready to start using this free blogging software, WordPress For Dummies, 2nd Edition is just what you and your blog need to make a splash.

WordPress Resources 0 Comments

Top 10 FREE Coming Soon WordPress Themes

If you are planning to create an application, or any other website you should really consider having a coming soon page. On that spash page, you should have an email

WordPress Resources 0 Comments

How to Add a PDF to Your WordPress Site

Lets say you want to add an article to your WordPress site. You want it to print “just right” so pasting it into a new page or post won’t work.

WordPress Resources 0 Comments

No More SLOW or Broken WordPress Event

WPfixt.com SUPER EVENT   LIVE webinar – March 11th at 10-12am PDT Giving you the secrets to SPEED up and FIX WordPress If you didn’t know already, Dynasty Web Solutions

0 Comments

No Comments Yet!

You can be first to comment this post!

Leave a Reply