Tag Archive: wordpress

Web Site Spring Cleaning

Every now and then, I get frustrated with the way my web site looks.  I toss a stick of dynamite at it and start fresh.

This weekend I splurged on the Headway WordPress theme, a premium theme that has a slick GUI editor.  I can make different pages look wildly different without too much effort.

Before

Before

After

After

Here’s some of the changes so far:

Reorganized links across the top – I used to organize pages by popularity, but screw that.  I’m going for more logical organization now, so I’ve got links for About Me, Books, Consulting, SQL Server Articles, SQL Server Training Videos, Twitter, and Upcoming Events.  The Consulting and Videos sections are new, and I’ll be fleshing those out more over the coming weeks.  Yes, I still work for Quest full time, but I do consulting in my spare time.

Featured Video on the home page – I’m uploading more stuff onto YouTube now that they support high definition video.

Rotating “Featured Posts” and “Woohoo!” sections – as you watch the page, some parts of it rotate every few seconds.  I used to have logos for the Microsoft MVP program, Tom LaRock’s blog rankings, my book, etc, and now those all just rotate.  It’s slow enough that it’s not too obnoxious.

Magazine-style home page and SQL Articles page – I’ve got a lot of buried treasure in the site: articles people find via Google, but they don’t find when navigating through BrentOzar.com’s menus.  I’m starting to expose more of the popular articles through these browsable pages.  I’ll add thumbnail images for them, but probably not until the next version of Headway.  Headway 1.6 doesn’t pay attention to WordPress 2.9′s awesome new thumbnail functionality.

I’m still working on it, but I had to stop pouring effort into it and get back to my MCM studying.  The jury’s still out on Headway.  The visual designer loads and refreshes very slowly, it’s got a steep learning curve, and some things don’t seem to work the way I would expect.  It doesn’t play nice in any way, shape, or form with the DB Cache Reloaded plugin – Headway’s Visual Editor tool barfs all over itself when the cache is on.  I have to keep remembering to disable the cache when I’m editing the site, or else things keep exploding.

If you take the Headway plunge, back up your database first.  Headway says it uses the search engine meta tag information from the All-in-One SEO plugin, but that was not the case for me.  I appear to have lost all my SEO work on posts.  Not a big deal – I’ve got daily database backups – but I’m guessing not everyone is so fortunate.

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

Website - Twitter - Facebook - More Posts

My Favorite WordPress Plugins Lately

In my series on how to start a blog with WordPress, I discussed a few plugins, but I’ve added a few more lately.  These are focused more at advanced bloggers who want to tweak the way their blog works.

Align Images in RSS Feeds – does what it says on the box.  WordPress uses styles to align images, but those styles don’t work in RSS feeds.  All images end up as non-aligned in the feed.  Eric Gray of VCritical (BlogTwitter) turned me on to this simple plugin that fixes ‘em.

Amazon S3 for WordPress – Amazon S3 is a cloud-based file storage service.  Think of it as a web host that charges by the byte instead of a fixed monthly fee.  If your site is suddenly linked by a really popular blogger, the images will be served off Amazon’s servers instead of yours, which gives you a much better chance of surviving without an outage.  It doesn’t include functionality for Amazon CloudFront, but another blogger has added code for that.

DB Cache Reloaded – I used to use the WP-Super-Cache plugin for caching, but DB Cache Reloaded works by caching database queries instead of completed pages.  This means it works better for more pages, plus it works with plugins that build every page dynamically.  Found this by looking at the source code for Stephen Foskett’s blog after talking with him about his web host and his page volume.  I was wondering how he could survive – this plugin is a big part of the answer.

Page Links To – in the menu across the top of my site, I wanted to include menu items for blog posts.  Normally WordPress won’t do that, because the menu is composed of only pages (not posts).  This plugin makes it possible.

Wibiya Toolbar – this is the little toolbar that goes across the bottom of my blog with links to Twitter, FaceBook, Flickr, and more.  After watching my web site analytics, I don’t think this is making people stick around the site more often or be more interactive, but I like the toolbar so I’ll leave it on.

Note: I’m on a cruise ship this week and won’t be responding to comments until Monday, January 11th.  If you post a comment that requires moderation, don’t fret – I’ll approve it when I get back.

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

Website - Twitter - Facebook - More Posts

Interview with Mike Walsh about blogging

Mike Walsh (BlogTwitter) is celebrating his one year anniversary as a blogger by revisiting why he got started, passing on tips to other bloggers, and upping his game.  He interviewed me about how I got started blogging, how I’ve changed along the way, and some tips that I’d recommend new bloggers think about.  It’s about a half hour long, so pour a hot cup of your favorite caffeinated beverage and turn up your speakers – the audio’s a little quiet:

Some of the links we talk about include:

Mike’s going to focus on blogging all this week over at StraightPathSQL.com, so head over there and check it out or subscribe to his RSS feed.  He’s got some good tips coming!

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

Website - Twitter - Facebook - More Posts

Finding Buried Treasure with Google Analytics

About once a month, I use Google Analytics reports to find out if any posts are getting a lot of hits from search engines. In Analytics, I click Content, Top Landing Pages, which pulls up this report:

Top Landing Pages Report

Top Landing Pages Report

What the heck?  #5 is a joke post about SQL Server 2010′s features being leaked.  That surprises me, so next, I want to find out why users are searching for this information. I click on that page name, then click Entrance Keywords:

Entrance Keywords Report

Entrance Keywords Report

Innnteresting.  I never would have expected that this post would remain popular long after I wrote it, since it was pretty much a throwaway joke.  I bet you’ve got pages like this too – you casually wrote a blog post to address one specific issue, didn’t really think anything of it at the time, and now there’s hits coming that you didn’t expect.

Now that I know the post has gained popularity, I can make it even more successful.

Helping Search Engines Find Your Buried Treasure

We’re going to make a series of changes in order to improve our search engine rankings. Ideally, we’d be doing this legwork for every post we write, but we don’t usually have that much time, do we? After all, we’ve got day jobs.

First, edit the post’s keywords to include more of the keywords that users were searching for. This will make it rise higher in search engine rankings. If you’re using the excellent All-in-One SEO Plugin for WordPress, edit the post and scroll all the way to the bottom of the page. Fill in each of the All-in-One fields, which are empty by default:

All in One SEO Plugin for WordPress

All in One SEO Plugin for WordPress

The fields are:

  • Title – defaults to empty, which just uses the original blog post title. If you wrote a funny post title that doesn’t really match up to the content, you can override it here. This override only affects how the search engines see your content, so you can be less funny and more accurate here.
  • Keywords – use the search keywords end users used to find your page.
  • Description – a one or two sentence description of the page that will show up as a search engine summary. WordPress uses the first sentence of your blog by default, but you might want to write something more descriptive.  It’ll show up in the Google results like this:
Google Search Results with Tweaked Meta Tags

Google Search Results with Tweaked Meta Tags

Presto! A nice, clean summary sentence instead of the article’s first sentence.

To be even more effective, we can tweak our post content too. I break up every few paragraphs of my posts with a header line. This uses the H3 tag in WordPress. Search engines give more relevance to your headers, so if you want to optimize your post for search engines, try to work keywords into your header lines.

Don’t go overboard. Readers can tell when you’re being slimy. It can be a tough line to walk, but at the end of the day you have to decide whether you want to be liked by search engines or by human beings. This post is a great example – my header lines here all talk about buried treasure, which frankly isn’t going to get me any search engine traffic at all. I’m fine with that, because this post isn’t the cornerstone of my blog. This is just for you, dear reader, and I’ll drive traffic to it another way.

Helping People Find Your Buried Treasure

Do a search in your own blog looking for related posts. You’ve probably written at least a couple of entries that somehow relate back to your newly popular page. Edit those pages, and add links directing people to your treasure.

If it’s a post you’re really proud of, link to it from every single page in your site. On BrentOzar.com, I have a Popular Articles section on the side of my site. It links to several of my most searched-for posts, plus a few posts that I just happen to think are spiffy.

Making the Buried Treasure More Valuable

If people are going wild and crazy over one of your buried treasures, put some elbow grease into it and polish it up. Add pictures, add sample code, and add most importantly, add links. If someone took the time to click on your link in a search result, they’ve probably got a lot of questions. Add a section at the end of the post called Related Reading, and include your own links plus the best you’ve found on the web. If you don’t know any offhand, take a few minutes to search. If you knew enough about the subject to write about it, then you probably know enough to pick out some good links in search that the reader would like. After all, they came to you for help – they may not know the good stuff from the bad right now.

Consider expanding your post to include more information covering the keywords that people were searching for. Let’s say you wrote about truncating SQL Server log files, for example, and people have started searching for how to truncate the log in SQL Server 2008 – which is no longer supported. You could add a paragraph or section to the post explaining that BACKUP LOG WITH TRUNCATE_ONLY no longer works, and include a copy of the error message users get when they try that stunt.

This is how my epic Twitter RT FAQ post got started. Originally, it was just a short post explaining what RT meant on Twitter because people kept asking me. Over time, I added more and more questions and answers because they were showing up in the search logs, and next thing you know, I’ve got a monster post going. The drawback is that my regular readers don’t see these added entries on such an old blog post, but frankly, I don’t write that material for my regular readers. I just keep adding to that post in order to help people who keep searching for Twitter information.

Rather than adding more and more to old posts, you can also write new posts to cover new information, and build links between your existing pages and your new ones. This comes back to the Related Reading topic we discussed earlier.

Sometimes, I find that I end up writing my Related Reading posts first! I start working on a post, and I realize I need some supporting material. That’s exactly what this post is doing here – it’s going to be link in tomorrow’s post. Stay tuned!

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

Website - Twitter - Facebook - More Posts

Bookmarks for September 25th

These are my recent favorite links:

Unfortunately, there’s more, but the WordPress plugin I’m using will only import 15 bookmarks per hour. Grumble. To see the full list of what I’ve been reading lately, either check out my Delicious bookmarks or subscribe to my Google Reader feed.

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

Website - Twitter - Facebook - More Posts

My Weekly Bookmarks for August 28th

Here’s my bookmarked links for August 23rd through August 28th.  I’m using an automatic plugin to build this list, and I can see that this probably isn’t going to work – I just found way too many things interesting in one week, and it doesn’t break stuff out into categories.  Blogger fail.  Here it is anyway as an example of What Not To Do during my Better Blog Week:

These bookmarks are automatically imported from my bookmarks at Delicious.com. If you’d like to get up-to-the-minute updates on what I’m bookmarking, you can subscribe to my bookmark RSS feed.

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

Website - Twitter - Facebook - More Posts

W3 Total Cache Plugin Review

Databases are slow.

I shouldn’t say that, because I’m a DBA, but it’s the sad truth – databases are often the bottleneck for web apps.  WordPress is just another web app – it builds pages by querying a MySQL database.  If we want WordPress to scale, we need to minimize the number of times it has to hit the database.  Reducing the number of plugins helps, but sometimes it’s still not enough.

I used to use the excellent WP-Super-Cache plugin to cache my blog pages.  It’s a filesystem-based cache that saves generated versions of your pages.  It works great, but you have to be very careful that all of your other plugins work well with it.  For example, I tried using a Google AdSense plugin that checked where you were coming from, and if you’d stumbled in via Google, it showed Google ads related to your search query.  Unfortunately, once that page got into cache, EVERYBODY saw the ads – whether they’d come from Google or not.  Bad.  I had to check every plugin I used and determine whether it was impacting my caching, and I ended up pulling a lot of good plugins out just so I could scale to more viewers.

W3 Total Cache has a whole different bag of tricks.  It uses memcached, a memory-based cache, and as a result it appears to be much faster than WP-Super-Cache.  The downside is that memcached isn’t available on most shared hosting providers.  It’s not even usually installed on dedicated virtual servers, so you’ll need to follow a few instructions to get memcached up and running first.  MediaTemple users can follow their memcached setup instructions.  (This is yet another reason why I love MediaTemple – their documentation is stellar.)  Other hosting company users still get an excellent checklist in the W3 Total Cache Installation page built into the plugin.

Since it’s a memory-based cache, memcached also requires more memory than WP-Super-Cache.  MediaTemple recently rolled out free memory upgrades to their hosting customers (did I mention that I love MediaTemple?) so I had more than enough available memory to handle it.

Beyond Caching: Options for Content Delivery Networks

When your site hits the front page of Digg or Slashdot, you might want even more scalability.  Content Delivery Networks, or CDNs, host your static files (images, css, js) on their servers, thereby reducing yet more load on your web server.  CDN companies replicate content across their worldwide servers, thereby making your pages render faster for users on other continents.

This option is probably overkill for 99.9% of the blogs out there, but when you need it, you have no time to set it up.  If you’re writing the kinds of content that you hope will end up on Digg’s home page, then you need to set up a CDN (and caching, for that matter) long before you need it.  My web site got knocked offline in May when Sherri Shepherd, one of the hosts on The View, linked to it, and I had to scramble to set up better caching and a CDN.  My site only really gets hammered once or twice a month, and using a CDN helps me survive those without getting an expensive dedicated server just for my blog.

W3 Total Cache has some support for CDNs that are accessible via FTP.  It will automatically upload your static files to your CDN, and update your web page code to the CDN without you having to lift a finger.  Unfortunately, Amazon S3 and Amazon CloudFront aren’t directly accessible via FTP, so if I chose to go that route, I’d need to switch CDN’s.  For now, I’m using the TanTan Amazon S3 plugin which uploads my post images to S3 and hosts ‘em there.  It doesn’t utilize Amazon CloudFront, so it’s not as fast as a real CDN, and it also doesn’t handle any of the CSS/JS/include files that W3 Total Cache will.  I’d really love to see W3 Total Cache implement CloudFront capability.

W3 Total Cache Also Shrinks Your Pages

W3 Total Cache can use HTTP compression (like GZIP) to shrink your pages, but it goes beyond that.  It will minify your JavaScript and CSS code, stripping out comments, spaces, and other things that don’t affect how the code works.  These things reduce the time it takes to download your web pages.  Here’s what one of my bigger pages looked like before W3 Total Cache minified it:

Before Minify

Before Minify

After W3 Total Cache:

After Minify

After Minify

Hubba hubba – almost a 30% drop in size without affecting content.  (Yes, I know it’s hilariously ironic to illustrate smaller web pages by using big screenshots.  I like images on my blog.  Get over it.)

Minifying Your CSS and JS Files

Minifying Your CSS and JS Files

It’s not point-and-click setup, though – you have to tell W3 Total Cache where each of your CSS and JS files are located.  In the screenshot here, I’ve entered in the exact locations of all of my CSS and JS files.  To find them, I could have tracked them down via view-source, but the easier way is to use a site like the Web Page Analyzer.  It points out all of the CSS and JS files that aren’t compressed and gives you the exact location.  You can copy/paste those into W3 Total Cache’s configuration, and it automagically handles ‘em.  It appears to be transparent to your plugins.

The downside of this manual setup is that you have to revisit it every time you change your theme or add a plugin.  W3 Total Cache doesn’t recognize that you’ve added CSS or JS files to your site.  I’ll have to set myself a reminder to use a web page analyzer once a month and make sure everything’s still working as designed.

Initially, you have to double-check your particular blog.  My CSS and JS files minified okay, but tag cloud broke when my HTML was minified:

W3 Total Cache Minify Bug

W3 Total Cache Minify Bug

It ripped out the spaces between tags, thereby rendering my cloud as long lines.  That one was easy to troubleshoot, but to fix it, I had to disable minification on my HTML, which cost me a little performance.  Other issues are not as easy to troubleshoot – I pity the fool who tries to view-source a minified web page, because it’s crammed together on a single line.  Well, not quite one line.

W3 Total Cache Adds a Footnote To Your Source Code

The plugin credits itself one of two ways.  By default, it tacks on a link at the end of your blog page.  If you uncheck that option in the Preferences page, W3 Total Cache instead adds a footnote inside your source code for anyone to see if they view your source.  Even when you choose to minify your pages, W3 Total Cache won’t minimize its own absurdly long footnote:

“This site’s performance optimized by W3 Total Cache:

W3 Total Cache improves the user experience of your blog by caching
frequent operations, reducing the weight of various files and providing
transparent content delivery network integration. The goal is to improve the
user experience for the readers of your blog without having to change
WordPress, your theme, your plugins or how you produce your content. When fully
utilized, your blog will be able to sustain extremely high traffic spikes
without requiring hardware upgrades or removing features or functionality from
your theme.

Features and benefits include:

– Improved progressive render (non-blocking CSS and JS embedding)
- Reduced HTTP Transactions, DNS lookups, reduced document load time
- Transparent content delivery network (CDN) support with automated media
library import
- Bandwidth savings via Minify and HTTP compression (gzip / deflate) for HTML, CSS
and JS
- Minification (concatenation, white space removal) of inline, external or 3rd
party JS and CSS with scheduled updates
- Optional embedding of JS just above </body>
- Support for caching pages, posts, feeds, database objects, CSS, JS in memory
with APC or memcached or both
- Caching of RSS/Atom Feeds (comments, page and site), URIs with query string
variables (like search result pages), Database queries, Pages, Posts, CSS and JS
- Complete header management including Etags
- Increased web server concurrency and reduced resource consumption, increased scale

Learn more about our WordPress Plugins: http://www.w3-edge.com/wordpress-plugins/

That content is tacked onto every single page, thereby adding more length to your site. Ugh – that’s the opposite of what I wanted.  I would have no problem with adding 2-3 lines summing up the benefits, but this is absurdly overboard.

There’s no option to switch it off in the preferences, either, but I figured out a sneaky trick.  In the preferences, you have the option to add their link either to the footer of your web site or to your blogroll.  Since I don’t use WordPress’s built-in blogroll feature, I used that, and voila – W3 Total Cache stopped adding that ridiculous footer.  Note to the author: either accept donations, or compromise on a fair length of credits in the source code.

W3 Total Cache Preferences

W3 Total Cache Preferences

But, ah, those preferences…

The Good News: Lots of Options. The Bad News: Lots of Options.

Bug Example: Missing Comments

Bug Example: Missing Comments

This plugin’s options and documentation set a high bar for other plugins.  I’ve never seen so much tweaking potential in a WordPress plugin.  It approaches the level of usability in the very tweakable Atuahualpa theme that I use here on my blog.  If a particular feature doesn’t work, like the HTML minify problems I had, you don’t have to throw the baby out with the bathwater – just uncheck that particular part of one feature.

All these preferences and dependencies, though, is an indicator of the targeted audience.  If you’re just getting started with caching, you can’t go wrong with WP Super Cache.  It’s easy to install, easy to configure, and hard to screw up.  If you’re willing to put more time and effort into installing, configuring and testing your caching solution, then W3 Total Cache gives you more choices and flexibility.

W3 Total Cache is still in its infancy, but already it shows great potential.  I’ve run across bugs – sometimes comments don’t show up right away, even though the correct number of comments shows in the post description.  For example, the post will say “3 comments”, but only 2 will display.  I’m going to keep checking it out as new revisions come out, and I hope they implement S3/CloudFront CDN caching in the near future.

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

Website - Twitter - Facebook - More Posts

Upgraded My Web Host

The good news: I’ve been getting a lot of web visitors lately.

The bad news: I’ve been getting a lot of web visitors lately.  The last dot is April (the down-slope is May, Google’s graph labels are goofy.)

Up Up and Away!

Visitors - Up Up and Away!

I don’t write my stuff in order to get hits.  I’ve always taken a simple approach to what I write: if I’ve got a problem, and I can’t find the solution quickly online, then I document my solution on my site.  Sometimes it’s about SQL Server, sometimes it’s about Twitter, and soon I’ll have a big post on how to build a Hackintosh.  The thing is, when you write something useful, other people do come visit, and it really starts to build up steam.

How I Started: A Shared Web Host

For years, I’ve relied on a shared web host plan from HostGator and been very happy with it.  For about $25/mo, you get 24gb of drive space and 250mb of bandwidth.  In April, I used around 3gb of disk space and 25gb of bandwidth to serve about 50k visitors.

However, as a SQL Server DBA, I can tell you that storage space and bandwidth have nothing to do with performance.

You can serve static HTML files all day long from a cheap shared web host, but when you introduce applications like WordPress, MySQL and 3rd party plugin applications, suddenly you’re talking about CPU and memory capacity issues.

The first workaround is to use caching: if your web site isn’t changing that fast (like if people aren’t leaving comments like crazy) then it makes sense to cache as much as possible.  Serve pages out of memory instead of rebuilding them every time, and you’ll cut down on the number of requests sent back to the database.  For WordPress bloggers, that’s as simple as using the plugin WP-Super-Cache: just install and enable it, and it automatically serves cached pages to your visitors.

Caching Isn’t That Easy

I lied: caching isn’t as easy as installing a plugin.  Oh, sure, that’s what the sysadmins will tell you, but it only works if all of your other plugins work correctly with WP-Super-Cache.  How can you tell?  Well, uh, you can’t.  The first problem I ran into was that the MobilePress plugin (which makes your site look better on iPhones and Blackberries) doesn’t always work correctly if WP-Super-Cache is enabled.  I decided to abandon mobile support in favor of caching, because I didn’t want my site to fall over when I got linked by someone famous.

Later, I played around with plugins to display ads on my blog if the visitor was coming from a search engine.  Statistics show that visitors from Google stumble in looking for a particular solution, and they’re more likely than other users to click ads.  Bloggers should avoid showing ads to their regular readers, because those folks aren’t tempted to click ads.  I dabbled with running ads on my old posts, and I ended up making around $100/month.  However, when I ran ads, the caching didn’t work correctly: they would cache the ad status based on the first visitor to the page.  If that visitor was eligible to get ads, then everybody who saw the cached page also saw ads.  I could disable caching, and then everybody got the right content, but then I was running a risk of putting too much load on my web site again.  That time, I decided to abandon ads in favor of caching.

This past Sunday I redesigned BrentOzar.com, and in the process, I temporarily disabled caching so that I could test my changes in several browsers & OS’s in rapid fire.  Sundays are usually low-traffic days, so I wasn’t too worried about load.  Erika and I drove over to my parents’ house to say goodbye before they embarked on a road trip, and when I came back home, my web site was down.

When Sysadmins Attack

Sherri Shepherd, co-host of The View, had Tweeted a link to my Twitter tips.  (Side note – after chatting with her for a while, I can see why she’s a host – she’s one of those people you just naturally want to open up to.)  She had about 68,000 followers at the time, and enough of them clicked on the link to make my web host notice.  HostGator’s sysadmins shut my site down for using too much CPU/memory, but they didn’t call me to tell me that.  Instead, they simply changed permissions on one of the PHP pages on my site so that WordPress wouldn’t work.  I had no idea my account had been shut down, so I started troubleshooting the site.

I found the permissions problem, contacted HostGator, and things went rapidly downhill from there.  I’m not going to go into details here because it’s not going to fix the problem, but I’ll give one particular lowlight: I was told by an engineer that I would need to call back later after the security team was done with their current stuff.  I wasn’t allowed to hold – I had to call back later when it might be a better time for them.  Riiight.

Douglas Hanna, the Customer Service Manager for HostGator, followed up with me the next day:

“I really can’t apologize enough for what seems like you serving as a example of Murphy’s Law at HostGator. Issues like this are difficult to deal with in the first place and I completely understand your frustration when we don’t deal with the issues properly on our end.”

Douglas and I had a long and constructive email thread about the problems I encountered, and he’s already started taking actions to make sure they don’t happen again.  At that point, though, I’d already moved my main site onto another hosting provider (MediaTemple) temporarily while I research the best dedicated hosting provider for my needs.

When You Should Upgrade Your Hosting Plan

In the process of researching hosting plans, I ran across a good summary of WordPress loads by David Seah:

  • 500 pageviews a day will be your first sign of strain if you’re using one of the el-cheapo $5/mo “unlimited” hosting plans.  You’ll need to look at caching or reducing your WordPress plugin use.
  • 1,500-2,000 pageviews a day will be your next wall with reseller web hosting plans.  You have to start paying attention to image sizes, plugins that load a lot of external files, comment spam, reliance on other web sites, and so on.
  • 3,000-5,000 pageviews a day starts to run into problems on shared server plans like my $25/mo plan at HostGator.  At this point you have to be really careful with your configuration, or consider moving to a private virtual server.

I’ve been doing around 3-4k pageviews on weekdays, but on peaks when I get links like Sherri’s, I hit 8-10k pageviews per day.  Even though I could probably hunker down, do some serious tweaking, and make it work on HostGator, it was time to kick it up a notch.  A dedicated virtual server would give me the power I need to run ads for Google visitors again, and that would pay for itself.

Even with moving to my own server, though, I still couldn’t ensure that the site wouldn’t fall over if Sherri tells Barbara Walters about it, so I’m taking another step too.

Caching Images on Amazon S3

Images take a lot of time to download relative to the text of a web page.  Even my fairly minimal web site had a lot of small images after my redesign.  To see how images impact page load time, get the free Firefox extension Firebug.  It shows a complete breakdown of all the factors involved with a page load.  The most obvious example is the large picture across the top of the site, which shows several of my portraits by TheFuzzball.  That image is roughly 70kb, and when hosted on my web server, it took over a second to download.

Instead of hosting that image on my web server, I copied it to Amazon S3, a cloud-based file storage service that can also act as a web server for static files.  I’ve talked about S3 here before, like when I started selling Twitter t-shirts with a site hosted on Amazon S3.  (Latest tally on that project: in the black by $50.)  The domain name i.brentozar.com points to an Amazon S3 storage bucket.  I changed the web template to pull the header image from S3, and now the download takes around 300ms instead of 1200ms.  Still not blazing fast, but better than 1 second, and furthermore, it takes more load off my web server in the event that I get a ton of sudden traffic.

This same technique can be used for images embedded in posts, too.  The TanTan Amazon S3 plugin for WordPress seamlessly swaps out the WordPress upload code behind the scenes so that when you upload pictures for your posts, they’re automatically stored in Amazon S3 instead.  Unfortunately, there’s not a quick way to migrate all of the pre-existing post images over to S3, but on the plus side, they still work fine on the local web server.  They just don’t take advantage of the Amazon S3 speed boost.  This weekend I’ll go through my high-volume posts (like the Twitter ones) and moving the images over to S3 manually, but I’ll leave the rest of the older ones on the local server for now.

Every Image Counts – and Costs

Social Homes Plugin

Social Homes Plugin

Every little image counts, though.  I recently added the WordPress plugin Social Homes, which shows little icons for all of your social networks.  Visitors can click on those links to jump to your profile on other web sites.  I loved the way it looked, but it had a horrendous impact on my page load times.  Other sites aren’t using the fastest web servers around, and they took quite a while to deliver the favicon files involved.

Here’s a screenshot of FireBug when loading my site, and notice all the favicon.ico files loaded from all over the web.

Loading Favicons From Everywhere

Loading Favicons From Everywhere

This didn’t make my web server perform poorly – after all, the images were already hosted on the other web sites – but it made my page load slowly.  Even worse, if one of the social networking sites was down (which happens more than you’d think) then the “Loading” stage would last forever on my web site.  To the visitors, it seemed like the page was loading slow, and that sucks.

The first thing I did was copy all of those favicon.ico files to Amazon S3 so I could cache them all myself.

Next, I copied the HTML produced by Social Homes, and used a text editor to replace the image names so that they pointed to my own site:

Old: <img src=”http://www.facebook.com/favicon.ico”…

New: <img src=”http://cached.brentozar.com/favicon-facebook.ico” …

Then I removed the Social Homes widget and replaced it with a plain text widget with my copy/pasted HTML.  Presto, faster page load times.

There’s a cost to this: I pay for bandwidth used at S3 as well as $.01 per 10,000 “get” requests.  If you sit here hitting refresh on my web page, you can run me out of pocket change.  On the plus side, though, my web site stays fast and stays up even if Ashton Kutcher name-drops me.

I’m ready.  Coming soon: how to build your own Hackintosh Pro.

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

Website - Twitter - Facebook - More Posts

How to Start a Technical Blog, Part 3: WordPress Plugins

Part 1 explained the reasoning and decisionmaking process, part 2 recommended using WordPress, and in this entry I’ll talk about what WordPress plugins I use here on BrentOzar.com and what they do.

FeedBurner FeedPress Gets You RSS Stats

Some of your readers will subscribe to your blog using RSS feeds. I won’t explain RSS here, but the short story is that even if you use Google Analytics, you still won’t know how many people are subscribed to you unless you get a free FeedBurner account.  FeedBurner, also owned by Google, gives you easy-to-read statistics about how many people have their virtual eyes on you.

The FeedPress plugin changes most (but not all) of the links on your blog to point to your FeedBurner feed, which gets you the statistics.  If you’re using a custom WordPress theme to change the way your blog looks, that theme may have hard-coded links pointing to your own WordPress theme.  (I had that problem here on my own blog.)  We won’t cover hand-editing WordPress themes here, although I will touch on that in my next and final How-to-Blog entry.

FlickrRSS Shows Your Photos

I use Flickr to store my photos online.  They have a free service that lets you upload a certain amount of photos per month that fits most people, and a $25/year Pro service for wackos like me who upload gigs of photos per month.

This plugin shows your most recent photos down the side of your blog.  I like seeing that other bloggers have a real life in meatspace outside of their blog, and I like looking at their pictures to see what they’re up to.  Adds some personality to your site.

After installing the FlickrRSS plugin, you have to use its widget.  With WordPress, your sidebars (and in some themes, your footer) is configurable as a widget, and you can drag & drop different things in there.  Drag the FlickrRSS plugin into one of your sidebars in the management UI to enable it.  I won’t cover that here because it’s about to change in WordPress 2.7.

MobilePress Enables Phone and PDA Users

I know, I know, you don’t care if iPhone users can see your blog or not, but this is really cool and easy.  Just grab this free plugin, and your web site will look amazing on iPhones, Blackberries, etc., and it doesn’t change the way your site looks on “normal” browsers.  It’s so easy that you can’t help but do it.

PingPressFM Gets The Word Out About New Entries

Whenever I post a new blog entry here, my blog automatically updates my status on Facebook, Twitter, Brightkite, etc to let people know that I posted a new blog entry.

There’s two parts to this: first, set up an account on Ping.FM and set up your social networks there.  Ping.fm is a cool web service that lets you update all of your networks in one spot.

Next, install the PingPressFM plugin and configure it with your Ping.FM info.  Then, whenever you post a blog entry, schazam, people know about it.  It even works when you schedule blog posts in advance – this particular post was written days before it actually went live, but when WordPress published it on a scheduled basis, bam, out went the Tweets and whatnot.  I do this because I’m not always in a writing mood: when I am, I’ll crank out a week’s worth of posts in a few hours.

Subscribe to Comments Keeps the Conversation Going

When I read blogs, sometimes I’ll leave a comment if I have a question for the author, if I disagree with something, or if I just want to thank the author for doing a great job on the topic.  But I’ll never know if the person responded, because I rarely go back to the same blog entry again to check for updated comments.

The Subscribe to Comments plugin solves that problem by letting commenters check a box to get emailed whenever a new comment is added to that entry.  That way, if a user posts a question and then I answer that question in the comments, they’ll get an email notification.  That quick feedback helps viewers know you’re paying attention to their comments.

There’s another way to solve this issue using Intense Debate, a company WordPress bought recently, but WordPress is undergoing changes and I don’t recommend this plugin for beginning bloggers. I use it here on my site, but it’s not quite ready for public consumption. It’s buggy as hell.

WordPress Database Backup Plugin Handles the Boring Stuff

Nice blog you got there.

It’d be a shame if something happened to it.

Rather than paying the mafia for protection, grab this plugin and it will email database backups to you every night.  Works best with email providers like GMail who allow absurdly large inboxes.

Make a Little Money with WhyDoWork AdSense

If you want to make money from your blog, you can show Google Ads on it.  I’d recommend only showing ads on posts older than a couple of weeks – that way you won’t annoy your regular readers, but if someone finds your older posts via a search engine, they’ll help pay your bills.  You won’t get rich – as of this writing, I’m making less than $100/mo – but it’s free money when your site gathers enough volume.

To use it, sign up for Google Ads, then go into WordPress and put your ad codes into Settings, WhyDoWork Adsense.

I’ve covered the mechanics of setting it up, and I’ve left the look and feel for last.  Hey, isn’t that how we IT people always work?

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

Website - Twitter - Facebook - More Posts

How to Start a Blog, Part 2: Configuring WordPress

In part 1, I talked about the basics of why you might want to blog for yourself (instead of a third party) and how to pick your domain name.  In today’s installment, I’ll cover what blog software you want to use and how to configure it.

Use Self-Hosted WordPress to Run Your Blog

There’s a bunch of ways to get your domain name up and running on the interwebz, and I think WordPress is the best because:

  • It’s open source, so it’s likely to stick around for a while
  • It’s absurdly popular, so there’s a ton of documentation on it
  • There’s a bazillion plugins to extend it in cool ways

The easiest way to get started is to use a hosting company.  BlueHost, GoDaddy, and Hostgator offer one year of web hosting for around $100. (There are many more hosting companies, but I’ve used these two for a couple of years and been very happy.) Between this and your domain name, we’re talking about $110 per year, which is a lot more than a free hosted solution, but this is an investment in your career.

After setting up your blog, it’s tempting to start working on the way it looks so that it suits your personality. I’m going to hold off on that particular topic for now because it’s a monster, and it involves designing and building a personal brand. I think that’s really important, but it needs to be a separate article. Instead, I’m going to keep going and hit the technical side of blog setup first.

Configure WordPress for Search Engine Optimization

Ugh, that phrase Search Engine Optimization is so slimy. It’s an industry of snake oil salesmen. I hate it. But here’s the reality: if people are going to find you, you have to show up in search engines, and there’s a few easy tweaks we can make to WordPress to help Google do a better job of analyzing your content.

With the WordPress default setup (as of this writing, WordPress 2.6 in late 2008) the default WordPress link to a blog post looks something like this:

http://www.myblogname.com/?p=125

That means nothing to me, and it means nothing to search engines either. Go into WordPress, Settings, Permalinks and choose Custom.  Put this in the edit box:

/archive/%year%/%monthnum%/%postname%/

And click save. (There are some people who don’t recommend using the year & month fields, and skipping those is completely OK too.)  That will make your blog post links look something like this:

http://www.myblogname.com/archive/2008/12/how-to-write-a-stored-procedure

That makes more sense to end users, and it’ll make more sense to Google too. Search engines use lots of bits of information to determine exactly what is on the web page it’s looking at, and the URL is just one part of that complicated formula.

Show the Full Post in Your RSS Feed

(Thanks to Jason Massie of StatisticsIO.com for reminding me of this one!)

Go into WordPress, Settings, Reading and set “For each article in a feed, show” to “Full text”.  That puts the full text of your blog posts in the RSS feeds.  RSS feeds are a convenient way for readers to stay on top of dozens or hundreds of blogs without pulling their hair out.

The other option is to just show the first paragraph or so in the blog post, and then force readers to click on a link to visit your blog site.  Readers hate that because it slows them down, and the whole reason they use RSS in the first place is to read more blogs faster.  Readers (me included) will simply unsubscribe from a blog that pulls that trick.

Why would people ever use that option? Because they have ads on their web site and they want people to see the ads.  We’re not that kind of people, remember, because we decided early on that we were blogging for career development, not to make $15 per month.

The All-In-One SEO Plugin

This does some behind-the-scenes housekeeping to make WordPress blogs more accessible to search engines.

To install it, go to the All-in-One SEO Plugin web site and download it.  Unzip it and FTP the contents to your web site’s /wp-content/plugins directory.  WordPress automagically detects plugins in any subdirectory of that, so I like to make a subdirectory per plugin to keep the housekeeping simple.  After uploading it, go into WordPress, Plugins, and scroll to the bottom where it lists plugins that can be activated.  Click Activate on this plugin, and you’re in business.

It works great out of the box, but if you’re really ambitious, you can pay attention to these fields when you write a blog:

Title – the text that appears in your browser’s title bar. If you look at the top of your web browser right now, the title of the program window is “Best WordPress Plugins | BrentOzar.com SQL Server DBA”. If you scroll down and look at the text at the top of the article, though, the page starts with “How to Start a Technical Blog, Part 2: WordPress.” The All-in-One SEO Plugin makes this magic happen. There’s a lot of weird science here, but in a nutshell, the Title should be very search-engine-friendly, whereas the blog article title should be short, funny and friendly. Don’t take this as the gospel truth, by the way – this is just what I hear from our SEO guys.

Description – the text shown to users when they see your web site in search engine results, like this:

Keywords – a few words or phrases that really describe what the blog post is about.  For example, in this blog entry, I might use these keywords:

  • blogging
  • WordPress
  • WordPress plugins
  • configuring WordPress

Whew – what a pain in the rear, right?  I know, I rarely screw with that stuff too.  But before you abandon hope, forget manual configuration – there’s a few more plugins we can install that’ll make it much easier for people to find your blog.

Use the Google Sitemaps Plugin and Google Webmaster Tools

This builds a sitemap file that Google’s bots use to analyze the contents of your entire web site without having to actually scan your entire web site. It’s a map of your site, and for each page, the Google Sitemaps plugin notes how often that page has been updated. That makes it easier for Google’s bots to find what’s new on your web site more frequently. This is only anecdotal evidence, but I can say that before I had a sitemap, my blog’s front page wasn’t updated very often in Google – say, maybe once a week if I was lucky. Now, Google updates its cache of my site’s front page every single day. That’s helpful because I blog about recent technology news, and when people search for information about breaking SQL Server news, they can find it on my site easier – instead of not seeing it for a week or more.

Next, tell Google about your newly created sitemap. Go to Google Webmaster Tools and set up your web site. Tell Google about your site’s sitemap, and check back a day or two later. Google Webmaster Tools will tell you about any problems it’s encountered on your site (which shouldn’t be the case if you haven’t done anything nasty in WordPress) and provide you with some interesting metrics about how many sites link to yours, how many people are reading your RSS feed, and so on.

That’s only scratching the surface of metrics, though. To really dive in, Google gives us another free tool…

Use Google Analytics

Go to http://analytics.google.com and sign up for web site reports about your site. Google will give you a small snippet of code to put on your web site. The easiest way to make that happen is to install the Google Analyticator plugin for WordPress, which will automatically insert the Google ad tracking code on every page.

Even if you don’t care how many people are reading your blog, I’d suggest setting up Analytics because if you start caring down the road, you’ll have a nice in-depth history of your site’s activity. It doesn’t cost anything, doesn’t slow your site down, and doesn’t affect your readers.

Google Analytics tracks a ton of metrics about your site. Here’s some quick definitions:

  • Visits and Pages/Hits – Visits is the number of people who came, and pages (or hits) is the number of pages that were viewed.
  • Bounce Rate – the percentage of people who saw one page and left. Obviously, you want that as low as possible.
  • Avg Time – how long people are spending on the site. I don’t think this is really useful for the site overall, but it IS useful when you’re comparing your pages. I like to know which pages people are spending the most time on, because that means they’re reading it carefully and digesting it.
  • Entry pages – Entry pages are where people came in, and no, it’s not always your home page. Search engine users will land on whatever page they found in the search engine, and referred people (folks who clicked on a link to you from some other site) land on whatever page the other site linked to.
  • Exit pages – The last page the user saw before they screamed in horror and closed their browser (or clicked on a link to go somewhere else.)

I’m a DBA, so of course I love to slice and dice my data, and that’s where Segments come in. Segments break up your audience into groups like Search Engine Traffic, Referrals (people who clicked into your site via a link) and Direct Traffic (people who came straight to your place). If you’re just getting started, then you won’t have too much data to slice and dice, but just make a mental note of that capability and come back to it in six months.

That’s a Good Start

Even if you don’t do anything else to your blog, you’ve already made a big difference in your ability to be found by readers.  But there’s a whole lot more, and in my next post, I’ll list the rest of the plugins and techniques that I use to help people interact with me.

Continue to Part 3: The Best WordPress Plugins

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

Website - Twitter - Facebook - More Posts