Archive for the ‘Tips’Category

Top 5 Tricks to Speed Up WordPress

Let’s face it: WordPress is not the most svelte of content management systems. But as we all know, it gets the job done.

And it’s not THAT slow, really. It’s just that it’s really easy to drag it down, especially in light of all the nifty bells and whistles you can throw in.

There are scores of ways to speed up WordPress, but many of them are highly situation-dependent. I want to focus on just the top 5 tweaks that will speed up WordPress page loads for EVERYBODY.

Tweak wp-config.php

Every time WordPress loads a page, it looks up the base URL of the website in the database. If I didn’t know WordPress so well, I’d be saying, “Are you fscking kidding me?”

But that means we can save a couple of database lookups, easy. Let’s add the following lines to the wp-config.php file:

define(‘WP_HOME’, ‘http://wordpressconsultant.net’);
define(‘WP_SITEURL’, ‘http://wordpressconsultant.net’);

How much this tweak speeds up your page loads will depend on the configuration of your server and database and what kind of strain they are commonly under. Dreamhost shared-host customers often see the greatest benefit here. (No offense, Dreamhost! You guys are great. Don’t kill my accounts. haha)

Use a Caching Plugin

This one trick can improve your page load time significantly (by how much will depend on your hosting provider), because it essentially lets the WordPress engine be a slacker: when a query comes in that exactly matches a page load already completed for a previous website viewer, the caching plugin will serve up a saved, static page instead of a dynamically generated page.

Plenty of decent caching plugins exist, but the one I’ve come to standardize on is W3 Total Cache.

Use of a caching plugin is also the #1 way to prevent site overloads during heavy bursts of traffic (we used to call it “getting slashdotted” back in the day).

Cut Back on Dynamic Page Elements

Pop Quiz, hotshot! Which do you think loads faster?
<?php bloginfo(name); ?><?php bloginfo(description); ?>

or

<title>The WordPress Consultant</title>

I hope you guessed the second one.

This tip regards the coding (or choice) of WordPress themes: wherever possible, replace dynamic lookups with static displays.

Do you really need to be able to set all of your META keywords in an admin interface in the WordPress Dashboard? If you think you do, consider that each one of those configurable elements kills another baby CPU cycle.  Think of the child processes!!

(I realize that many webmasters concerned about optimizing page titles for SEO purposes will want to dynamically set their title tags, so the above example was chosen for ease of illustration, and also to encourage tedious pedantry in the comments.)

Prune Plugins

Each time WordPress loads, it spins up each and every plugin marked as Activated in the Dashboard. If you have lots of fun “might use it someday” kinds of things hanging out in there — or worse, plugins you used to use but have let languish in obscurity — then it’s time for some spring cleaning.

Go through the list and Deactivate and/or Delete all the plugins you don’t use. You may be surprised at how well your site runs after this. Many older websites frequently see “gremlins” (unexplainable system behavior) disappearing after getting rid of unused plugins.

Look, it’s time for a little self-honesty. You’re never going to do a podcast. Or at least, you’re not going to do one this week, and having that plugin turned on is making your website LESS AWESOME. De-activate PodPress and get on with your life.

Work the Kinks Out of Your Database

You might be able to speed up your database queries by eliminating crufty old tables and bits of data no longer relevant to your interests. Get phpMyAdmin, which is not a WordPress tool per se, but can be used to “Repair” and “Optimize” your WordPress database. You can also use it to scan for tables related to plugins you no longer use so that you can delete them.

My Secret To-Do List

This is it! The above are the 5 operations I go through on every single WordPress site I install, fix, upgrade, and maintain.

According to Matt Mullenweg at WordCamp 2011 just this weekend, roughly 22% of new domains this past year were set up with WordPress on them (I think I was responsible for like 1% of them). You can help make the web faster by implementing the above 5 tricks to speed up WordPress.

15

08 2011

Squeeze Page Templates: Using WordPress for Squeeze Pages

WordPress is good for making squeeze pages (websites designed to encourage the extraction of the viewer’s email address and/or credit card numbers). You could set up static HTML to make your squeeze pages, but with WordPress’s plugin system you can get analytics, A/B testing, and other fun stuff up and running quickly. And whenever you need to modify your sales copy, there’s no need to dig through website code — you just edit the Page in WordPress.

Here are a few WordPress squeeze page templates I dug up around the web, along with how much they cost. Bonus: we learn a little about copywriting and keyword research along the way.

WordPress Squeeze Page Templates

Free WordPress Squeeze Page Theme Cost: your email address. (Of course!)

Notice they’re all named pretty much the same thing, because people who make squeeze pages are usually trying to claim search engine traffic for keyword phrases that, you know, actually get searched a lot.

WordPress Squeeze Pages Cost: $47

They all pretty much look the same, too, because they’re following the patterns laid down by guys like Frank Kern, Ed Dale, Mike Filsaime, and Joe Vitale, who have made millions with their copywriting.

WordPress Squeeze Page Cost: $10

The above will get the job done, I’m sure. But this one’s my favorite:

A humble but very good looking squeeze page template by CEA Web Solutions. Cost: Totally and completely free.

How to Run Squeeze Pages in WordPress

The disadvantage of using WordPress for squeeze pages is the performance hit. Each time the page loads, you’re running the whole WordPress engine to generate the page…

…unless you don’t! This is where a plugin like W3 Total Cache really shines. Since you’re just serving up the exact same page every time, with little to no dynamic content whatsoever, you’ll get all the benefits of WordPress with almost no downsides when you configure your squeeze page site to use W3 Total Cache.

But still make sure you install the site on a reasonably fast web host, one that can handle a lot of web traffic. If you’ve studied your target keyword traffic well, you should have a good grasp on the actual numbers you’ll need to handle.

10

08 2011

How to Bulletproof Your Blog

Socialmouths.com posted this list of great tips for how to keep your WordPress blog safe from such internet hazards as data corruption, malicious hackers, and the dreaded “oops I deleted it” error.

Go read them all, but here are a couple of really clever ones:

Automatic Database Backup

Here’s how you can have your WordPress blog’s database emailed to you on a regular basis. (Most people’s blog databases only take up a few megabytes.)

There are a few Wordpress Plugins that can perform a remote backup of your entire database.

The one I’ve been using for a while is called Remote Database Backup, it’s very easy to configure and it gives you very few options to worry about. You can manually run a backup at any moment and drop it in your hard drive or  you can schedule hourly, daily or weekly backups to be delivered via email as you can see in the following image.

Scheduling blog database backups

Set it up and forget about it! Even better, if you have an additional email account to manage your subscriptions and other services, have your backups go to that address, you don’t need to be looking at this stuff every day.

Automatic File Backups to Dropbox

You’ll need a (free) Dropbox account for this one. If you haven’t used Dropbox before, then you’re in for a treat. The service allows you to sync a few gigabytes for free (or hundreds with a paid account) across as many computers as you want.

Now there’s a WordPress plugin that lets you automatically backup the files that your website is made of to Dropbox.

Step 1: Install the Plugin WordPress Backup to Dropbox and activate

Step 2: Click “Authorize” to be redirected to your Dropbox account

Connect WordPress and Dropbox to run blog backups

Step 3: Allow. That’s it.

16

07 2011

Mobile Browser ID Strings

Zytrax.com keeps an astonishingly well maintained webpage listing every possible ID string sent by web browsers on mobile platforms. Everything from the most recent Internet Exploder string, iPhone, Android, all the way down to the now-defunct PocketLink for PalmOS. They got everything.

Tags:

13

07 2011

How to Create a WordPress Theme Demo Site

Sometimes you want to give a remote client a few different options for the same website, and you don’t want to do a lot of back-and-forth with them about it. Besides, some variations are super quick to make but much slower to explain. A demonstration is in order!

The goal is to allow the client to go to the site and sift through several different theme choices that you make available.

The first step is to set up a separate WordPress site for this purpose. You could use the client’s own website if it’s not yet “live”, but I would advise using one of your own properties, making sure to un-tick the checkbox for “Make my site searchable by Google, Technorati, etc.”

(By the way, setting up WordPress itself is outside the scope of any of my articles; if you’re reading my blog, you’re probably pretty well beyond that.)

I have a “site layout demo” set up on a subdomain of wordpressconsultant.net (with its own WordPress installation, not a WP multisite sort of thing).

Next, install the themes you’ll be making available. If it’s variations on one theme, make sure they’re all different folders in the /wp-content/themes directory and that their meta-information in style.css contains different names from one another (otherwise your client’s going to be choosing from a maze of twisty themes, all named alike). Choose one to Activate, and then you’re done with that step.

Now we’re going to grab two excellent plugins that save us a hell of a lot of time.

The first is WP Example Content. This handy-dandy plugin allows you to deploy dummy content containing all of the typography gymnastics the client is likely to want to check out. Thoughtfully, the plugin gives you a button to instantly retract and make disappear these content-less posts and plugins at a moment’s notice.

The second plugin we want is Theme Switcher Reloaded, which provides a widget that creates a list of themes available for the website viewer to switch between.

The sad thing, though, is that when you load in a different theme, you lose your widget options and can no longer see the Theme Switcher Reloaded list in the new theme’s sidebar. Whoops!

Now you have two options. You could deploy the following code into every sidebar.php of every theme you’re displaying (changing html tags as appropriate):
<?php if (function_exists(‘wp_theme_switcher’)) { ?>
<h3><?php _e(‘Themes’); ?></h3>
<ul>
<?php wp_theme_switcher(‘dropdown’); ?>
</ul>
<?php } ?>

OR… You could create a Page that functions as a makeshift Theme Switcher:

Configure the widget on one of the themes and then go load the site in a browser. The list of theme choices will show up in the sidebar (like you told it to do!). Do a control-U to look at the HTML source of the resultant page, and look for the list of theme choices. You’re scouting for an unordered list that has a lot of the following string in its links:

?wptheme=

So now copy everything between the two UL tags, and abscond with it to the site’s dashboard, where you will create a new Page or Post. Paste the pilfered HTML in, hit publish, and voila! You’ve got a “theme switcher” that sticks around between themes.

I went one better and set this new Page to be the content that displays when the root site is loaded. That way it’s always obvious where to find the site layout options.

And that’s it! That’s basically all you need to do to set up a theme demo site within the span of 15 minutes.

Did you find this post useful? Have you done something like this before? Do you think you have a better idea, punk? Let me know!

25

06 2011

Search Engine Optimization is Trivial (Link Building is Not)

A very significant portion of the WordPress consulting I do revolves around getting the new website noticed by search engine users. So in my consulting, the topic of Search Engine Optimization (SEO) comes up often.

The common perception seems to be that SEO-ing a website is a difficult or tricky process, and that there’s an inordinate amount of stuff to learn to get it right.

Well, it’s not. SEO is trivial. Read the rest of this entry →

21

05 2011

Handy Tool to Generate Gradients in CSS

Sometimes you need a gradient in a place in your design that will be dynamically sized. Using an image for a gradient background in this case will result in something awkward looking.

Here’s a background gradient generator that produces pure CSS gradients, for your convenience!

I generated this lovely horizontal-gradient blue box generated using the above tool.

. . .

Compatibility

Chrome, Firefox, Safari: This code should generate gradients in webkit browsers with no problem.

Internet Explorer: This code probably won’t work on any Internet Explorer version prior to IE9… which as of this article, isn’t released yet.

Opera: Some developers have reported that replacing the -webkit- prefix with the “-o-” prefix allows this code to work in Opera. Others have reported that Opera now respects CSS that works in webkit browsers, so perhaps it’s now a nonissue.

25

04 2011

Using WordPress for Science

Science blogging really took off in 2010, as the ever-popular scienceblogs.com hit its stride and traditional publications like Nature and even WIRED launched their own science blog networks.

But most blogging systems aren’t up to the task of providing science-minded bloggers with the right tools for presenting and discussing science. The ability to in-link to reference items in the middle of pages, for example, or easy-to-use footnotes are among the many features that simply don’t come standard with WordPress or any other popular blogging platform at the moment.

Blogging Beyond the PDF, a website devoted to science writing on the web, has taken on the task of cobbling together an adequate science blogging system using WordPress and an array of appropriate plugins. Check out the plugins page, where you’ll recommendations for turning WordPress into a science writing platform worthy of note.

10

01 2011

How to Turn Your WordPress Backend Into a News Room

WordPress makes a pretty good content management system for any news organization as-is, but a number of freely available open source plugins can turn the WordPress backend into a professional collaboration tool par excellence.

Out of hundreds of potential plugins, 10000words.net distilled down to 6 “Must Have” WordPress Plugins for Newsrooms.

Want to be able to create assignments shared by an editor, a journalist, and a photographer who will all work on separate sections of the article? Then grab Assignment Desk, created by NYU students specifically for the demands of a newsroom.

Looking to transcend the boundaries of the traditional “document”? Feedback By Paragraphs lets readers post comments to specific paragraphs in your articles. And WinerLinks automatically attaches a permalink to each paragraph, so other sites can not only quote you, but lead their readers directly to the source.

Perhaps the most useful of the bunch, EditFlow “helps you streamline your editorial workflow within WordPress by expanding upon native WordPress features”, letting you assign process-oriented statuses to your posts.

Read more at 10000words.net.

25

11 2010

BlogPress SEO: Blatant Spam, Malicious Code

DO NOT use BlogPress SEO. If you’ve installed it already, uninstall it right now, change your passwords, and also change the email address you use for your admin user. Why? Read on.

While you should be suspicious of any WordPress plugin claiming to optimize your search engine rankings, it should go without saying that a plugin claiming to provide “100s of backlinks” without any work on your part ought to be well avoided.

Blogpress SEO was recently evaluated by Yoost de Valk and found to be exactly what you might expect: pure spam, and likely to get you banned from Google for being a part of a link scheme. Says Yoost:

You know what the funny thing is? The bad stuff doesn’t end here. In the email they sent me, they also alluded to a paid version of their plugin, to be released soon:

“The paid version of the plugin will not exchange links, but just allow other blogs to place links and will not place any outgoing links on users blog.”

You know what we call that? We call that buying links. Now whether or not you’re morally opposed to that doesn’t matter, Google is.

The plugin also adds a link back to itself in a hidden DIV. So when Google gets wind of what BlogPress SEO does — and it would be ridiculous to think Google didn’t know about this by now — there’s a handy-dandy tattoo on every website with it installed, so Google will have no trouble identifying these link-spam participants.

Luckily, it’s quite easy to detect whether a blog runs this plugin, so Google will probably eliminate those quite easily. The risk you run? Well, I’ve seen sites get banned for participating in programs like these in the past. Like, banned from Google entirely, getting no traffic from Google anymore, nothing, zero, nada, zilch. Is it worth that? Thought not.

He also noticed in the code a place where, every time the plugin is run, it sends an email to info@blogpressseo.com containing the admin user’s email address. Hmm, what might that be about?

Mtekk figured it out, finding another piece of code that completes the tale of malice:

Just append ?loginyes=1&email= to any url on a site running this script will get you in, all you need to know is the email address of the admin.

So, to sum up, BlogPress SEO provides you all of these fantastic benefits:

  • Turns you into a link-spammer, which Google has no trouble identifying and punishing by making you invisible.
  • Leaves tons of tell-tale signs for Google to know that you’re running the plugin, thus making it even more likely you’ll be Google-slapped.
  • Creates a backdoor so that anyone who knows your admin email address can log into your site without a password.
  • Hands the keys to your site over to the jerk who wrote this plugin.

The moral of this story: THERE IS NO MAGIC SEO BULLET!

There are a lot of jerks out there who know that lure of easy SEO and magical no-work backlink building makes people likely to install things without thinking about it. Don’t be taken advantage of!

Automatic backlinking might give you fast results, but the search engines get smarter every day — don’t think you can outsmart the search engines. The evidence shows that Google, and probably Yahoo and Bing as well, have ways of identifying and punishing domains that try to game the system. And when that happens, all of that black magic not only will have done absolutely nothing for you, but you will have a hell of a time just recovering your domain name from search engine purgatory.

Good SEO isn’t hard, but it does take work. Beware of any plugin that promises money for nothing.

17

11 2010