SEO for WordPress: Rank VS Tank

Definitely a not so discussed topic in my blogs. The ever evolving monster known as Search Engine Optimization is a huge consideration when driving traffic to your site… at no cost. Free. How much better does it get?

Recently, I started using some cool new tools from Google and the results are still standing by. Other than using Google Analytics to check visits to your site, using Google Webmaster Tools in combination with Google Page Speed developer tool, should help you not only achieve a cleaner and clutter less site, but rather a site that doesn’t get negative ratings from Google.

As we know, Google is still the most popular engine out there, and we want to make them happy. Recently, I like Google’s push towards more related content. Long gone are the days where losangeleslawyers.com was a good domain for SEO because the domain name had the three most searched terms when someone looked for Los Angeles Lawyers in google. Nowadays, it’s about branding. LoAnLa.com would rank much higher if the description of the site had to deal with LA Lawyers, and the content of the homepage was kept to a less than 200 words page all about the lawyers in Los Angeles.

Because I’ve mentioned them several times in this post, I might actually get dinged by Google since I’m not really talking about them in particular, but I’m only using them as an example. It’s good to keep relevant text on your site, and chose ONE subject to talk about. Don’t put all three of your businesses on one website hoping that you can do cross promotion or something crazy like that.

I hope this can help some of you out there to better rank your pages, rather than tank your pages.

Oh, and for goodness’ sake, clean up your HTML folks. If it doesn’t look good in IE8, it’s probably your fault. I had to spend an entire day tracking down an extra double quote in one of the ads I used. Valid HTML is definitely a plus when Google checks your site. Not only it makes your website faster to load (milliseconds), but visually, more attractive to IE visitors, and there’s about 13% of those around the web as stated by w3schools.com.

One last note. Stop saying SEO Optimization. You sound like a damn fool!

“Search Engine Optimization Optimization”, yes, that’s what you’re saying.

Happy Optimizing.

Site Migration Plugin for WordPress

I’m in the process of finishing up the first version of the plugin that will make site migration really easy for anyone who wants to migrate their sites entirely from one environment to another. This is a great tool for someone setting up their environments initially. Messing around with the database is not a great idea, so this plugin will handle all of the table copying, etc. The requirements are to have a repository in SVN. A future version will have other repository features, such as GIT.

And here’s the first version for your amusement. Modify to your heart’s content, and send me some notes. I know a lot can be fixed and re-factored to make it better.

okm-sitemover

How to Migrate a WordPress Project

When working on WordPress projects, and you need to migrate, let’s say from LOCAL to DEV, or DEV to STAGING, or STAGING to LIVE, whatever the case may be, you need to keep a lot of things in consideration.

Here’s my setup:

  • SVN holds any custom themes or plugins, not the core files, or config files.
  • Multi-tier environment with dropbox backing up local files. (LOCAL, DEV, STAGING, LIVE)
  • LAMP dev environment.

Before you migrate, setup WordPress:

  • Create an entry in the hostfile if necessary
  • Setup the vhosts file
  • Unzip WordPress in the new folder in all environments
    • public_html/newsite.com/dev
    • public_html/newsite.com/stg
    • public_html/newsite.com/www

Let’s go through the basic list:

  • Make sure core is not in SVN. Only keep changes, and new development in SVN.
  • Make a list of plugins used.
  • Extract WordPress in the folder you want to install the website.
  • Copy database to new database.
    • Change DB URL
    • 1
      UPDATE wp_options SET option_value = REPLACE (option_value,'old.domain.com','new.domain.com');
    • Typically from dev.website.com to stg.website.com for staging
    • And dev.website.com to website.com for live.
  • Copy wp-config file to new folder if settings are the same.
    • Change db login credentials.
  • Do a checkout of SVN project in doc root.
  • Re-install all plugins.
    • Configure plugins.

This should be it. I wouldn’t mind working on a custom plugin to handle all this. Maybe add some custom code to do svn updates on the other tier levels as well, so all I would have to do is click a button, and BAM, svn updates to next level.

I might even dedicate a page for this. Standby for this feature.

Clear floats with overflow: hidden

Lately, I’ve seen a trend of programmers adding on new elements to pages in order to add a class to them to clear all of the floated elements in a container. Why? Simply use overflow hidden on the parent, and like a miracle, bam! The container becomes aware of all of the children elements.

The old way:

1
2
3
4
5
6
7
<ul>
    <li><a href="/">Text</a></li>
    <li><a href="/">Text</a></li>
    <li><a href="/">Text</a></li>
    <li><a href="/">Text</a></li>
    <li class="clearfix"></li>
</ul>
1
2
3
4
5
6
li {
    float: left;
}
.clearfix {
    clear: both;
}

The old way is not as effective, since we have to add additional elements that do not show anything. Their only purpose is to fix a css style. Why not do it in css? This method also adds what seems like an additional line that makes it seem like you have bottom margin, or padding. Too much to maintain and fix. Additionally, I believe at the time of this writing, google looks for empty elements and dings you if you don’t put anything in them. Validate your HTML. Be a good programmer.

The new way:

1
2
3
4
5
6
<ul>
    <li><a href="/">Text</a></li>
    <li><a href="/">Text</a></li>
    <li><a href="/">Text</a></li>
    <li><a href="/">Text</a></li>
</ul>
1
2
3
4
5
6
ul {
    overflow: hidden;
}
li {
    float: left;
}