Archive for the ‘D’ Category

How To Backup MySQL Database Without PhpMyAdmin

Tuesday, September 2nd, 2008

Ever since my host upgraded my admin control panel to Plesk 8.3.0, I have been running into problem backing up large MySQL databases using PhpMyAdmin. For whatever reason, the export function will only generate 0 byte SQL backup file. Moreover, it’s becoming quite a chore to backup 9 databases spread across 7 domains — there’s a lot of clicking in Plesk and PhpMyAdmin to accomplish this. As such, I had to look for and easy way to backup large MySQL database that doesn’t require PhpMyAdmin.

shell
Photo by Melete via Flickr

Backup MySQL Database Via SSH

So I did a little digging today and found an alternative that helps you easily backup large MySQL databases. The solution is to backup your MySQL databases through SSH. Here are the steps.

  • Enable shell access inside your Plesk control panel
  • Using utility such as PuTTY, log into your server via SSH
  • Change to the directory where you want to save your backup files — e.g., CD wwwroot/dbbackup. If you don’t have a directory created, follow these steps:
    • FTP into your server, using software such as FileZilla Client
    • Go to your domain root directory
    • Create a folder — e.g., call it dbbackup
    • CHMOD the dbbackup folder attribute to 777
  • Using mysqldump command to export the database into a file on the server. For example:

mysqldump --add-drop-table -u db_username -p db_name > mybackup.sql

About the command:

  • Omit the –add-drop-table argument if you’ll want to merge this backup with an existing database upon restore
  • Replace db_username with the name of your database user
  • Replace db_name with the name of your database
  • Replace mybackup.sql with the name of your backup file

Note: You can find your database name, user, and password information in your wp-config.php file (if you are using WordPress).

  • Enter your database password when prompted

That should be it. The command executes very fast and you should be able to FTP into your web site and find the backup file in the folder you created earlier. If you have multiple databases, all you have to do is replace the database name, user, password, and backup filename information.

Get More Search Traffic With Keywords Optimization

Saturday, August 16th, 2008

If you have been blogging for a while, chances are you’ve been getting some traffic from search engines. For example, based on Google Analytics my personal finance blog received 12,707 total visits via 8,513 keywords in the past 30 days — of which, the top 50 keywords produced 4,876 visits (or 38%).

Traffic
Photo by Spiritokko via Flickr

What can we derive from this information?

  1. It’s a mistake to focus on a few keywords. I often see new webmasters trying to rank for a handful of specific keywords that describe their sites. For example, I could’ve tried to rank Moolanomy for “personal finance blog” or “investing blog”, but that’s not where traffic will be coming from.
  2. Long tail keywords and search traffic are powerful. There are limitless numbers of search terms and you’ll not be able to anticipate them. So one of the best search engine optimization (SEO) strategies is to write as much high quality content as you can. Think of content as fishing net, and more content is like having a bigger net that allows you to capture more search engines traffic.
  3. Top 50 keywords give you the most return for your effort. It’s likely that a major portion of your search engines visitors found your blog through one of the top 50 keywords, so there’s a good opportunity for keywords optimization in this area.

How To Choose Which Keywords To Optimize

If you have to choose just 10 keywords to optimize, how would you do it? Personally, I don’t have unlimited resources so I try to focus on efforts that provide the best return on investment. In this example, I will show you how I identify the top 10 keywords that I feel will provide me with the most search engines traffic.

1. Identify your top 50 keywords and the amount of traffic for each

This is an easy exercise if you use Google Analytics. Just a few clicks and you’ll have access to this list. You can simply copy and paste the result into a spreadsheet. Here’s a small sample of my top 50 keywords.

Keywords Hits
passive income ideas 204
frugal ideas 179
extra income 103
larry swedroe 99
dave ramsey 93
frugal tips 92

When you are doing this, you’ll be doing it for all 50 keywords in order to get the final 10.

2. Identify current search engines ranking for your top 50 keywords

Next, I am going to add the search engines ranking for each keyword into the spreadsheet. For this exercise, I usually stick to Google search result since it’s my biggest source of search engines traffic. Moreover, to simplify the task, I recommend Digital Point Search Engine Keyword Tracker & Keyword Ranking Tool.

Updated 4/19/2009: You may no longer be able to get Google API needed for this application to work. If that’s the case, you’ll have to track it manually. You top keywords tend to be in the top 20 SERP positions so this is just a bit of extra work.

This is what my spreadsheet looks like after I add search engines rankings:

Keywords Hits Rank
passive income ideas 204 1
frugal ideas 179 3
extra income 103 10
larry swedroe 99 1
dave ramsey 93 18
frugal tips 92 16

If you run into keywords that you cannot identify the rank — i.e., not in top 100 — you can simply enter 999 for the purpose of this exercise.

3. Calculate the Keyword ROI Score

To calculate the keyword ROI score, you just multiple the number of hits by rank. The logic behind this is to focus on keywords with highest traffic hits, but lowest ranks.

Keywords Hits Rank ROI
passive income ideas 204 1 204
frugal ideas 179 3 537
extra income 103 10 1030
larry swedroe 99 1 99
dave ramsey 93 18 1674
frugal tips 92 16 1472

Note: With 50 keywords, the easiest thing to do is sort the list by ROI and look at the top 10 rows. You should skip any row with rank of “999” to find the top 10 with the best chance of improving.

Based on the example above, I should work on keywords like “dave ramsey”, “frugal tips”, and “extra income” instead of “frugal ideas”, “passive income ideas”, and “larry swedroe”.

How To Optimize Keywords For Better Search Engines Ranking

Now that you know the top 10 keywords you’d like to work with, there are a few things that you could do to improve your search engines ranking. For example, since I know that my article Extra Income Guide rank #10 in Google for “extra income”, I could do a few things to optimize it for better search ranking. Here are a few things that you could do to improve your blog article:

  1. Install All in One SEO plugin to optimize the title. Also it will add META keywords and META description to your post.
  2. Change the title of the page to include the word “extra income”
  3. Add headings — i.e., H2 and H3 — to include the word “extra income”
  4. Write custom META description for the post. Note, All in One SEO will use the first few sentences of your post, but this is not always the best META description.
  5. Add and/or modify tags in your post. Note, All in One SEO uses your tags as META keywords
  6. Search for the word “extra income” within the blog and link to your targeted article
  7. Ask your friends to link to the article using the keyword as anchor text

So there it is…a basic strategy on how to get more search traffic with keyword optimization.

How To Add Image Thumbnail Using WordPress Custom Fields

Thursday, July 31st, 2008

Over the past few days, I have been toying around with the idea of setting up WordPress as the CMS for a web site directory. One thing I wanted to do with my personal finance directory is to show a thumbnail image of the featured site when I am on the main page, category pages, tag pages, and search result pages.

As you know the thumbnail feature is not common in free WordPress themes, so I had to do some work to get it working. You can see how the directory looks below:

How To Add Thumbnail Image To WordPress Template

Now, let’s take a look at what we need to do to enable this feature.

1. Modify the main page (index.php) to show image

Note you could make the same changes to archive.php and search.php to get the same result. Note, I added the following code right under the title inside The Loop:

<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><img style="float:left;margin: 0 10px 10px 0;border:1px solid #000;height:90px" src="/wp-content/uploads<?php $values = get_post_custom_values("Image"); echo $values[0]; ?>" alt="thumbnail" height="90" /></a>

There are two parts to this code, the <a> tag and the <img> tag.

  • The <a> tag is the same as the one on the post title. I am adding it here so that users can click on the image to get to the full post.
  • The <img> tag has a couple of components:
    • The style attribute tells the browser to float the image to left, add some white space around the image, surround it with a black border, and make it 90 pixels high.
    • The src attribute tells the server to grab the image from /wp-content/uploads directory with the rest of path and filename information coming from a custom field called “Image”

2. Add custom field called “Image” to each post

Now, when you are writing a post, you need to add a custom field called Image to the post with a value that reflects the rest of image path and filename information. In this example, we will use the same image that is shown inside the post itself. To do this:

  • Upload an image to the post
  • Switch to HTML mode and take note of the image path (see image below) — note the image path is /wp-content/uploads/2008/07/annualcreditreport.png in this example.

  • Next add the custom field called Image. Note that we already defined some of the path information in the template — i.e., /wp-content/uploads. So you are adding the rest of the path information and filename in the value field — i.e., /2008/07/annualcreditreport.png. (see image below)

  • Save and you’re done!

That’s it! Your blog should start showing thumbnail image next to each post once you completed these two steps.

Things to consider

Right now, if the Image custom field is not defined, the template will show missing image error. With a bit of PHP programming using if-then statement to detect the if the custom field is defined or not, you could show the thumbnail only when the Image custom field is defined.

This article was featured in: