A few SEO tips

by Yang Yang on November 10, 2010

findHaven’t come up with any solidly helpful posts recently so I thought I’d throw in this one. These are some of the things I learned the hard way in the past few years for ranking my websites in Google. Hopefully you would find something new in here.

I rely on SEO to get traffic – in most cases, it yields the best traffic across all possible sources. With good SEO (both on-site content optimization and off-site reputation / link building), it’s hard to not make money. Especially if you are an expert in Internet marketing (niche research, reputation building & management, consumer psychology, landing page tuning, blah blah blah…), it’s even harder to not be rich. Making good money is easy, you just need time.

Don’t use a host that’s POPULAR and CHEAP.

Really popular hosts like hostgator and dreamhost have millions of domains hosted with them. Because they are cheap, spammers like them and Google knows it. I frequently launch new sites and from my experience with dreamhost, after submitting the new site at here, without building any backlinks, it typically takes 1 week or more to get it indexed.

However with hawkhost and wiredtree, it’s totally different situation. Without any initial backlinks, new sites can be indexed in Google 1 day after submission, even when it’s just a blank site with an empty Apache index page. Sometimes I didn’t even have to manually submit the site and it magically and automatically got in Google’s index.

Sites hosted with hawkhost tend to be more stable in Google’s index. However, it’s hard to keep a new site (with merely any content) in Google’s index if it is hosted with dreamhost (and similarly very popular hosts with cheap shared plans). Google would soon get rid of your new site if you don’t keep working on it.

Have a 4 year old website.

Adsense is one of my favorite money makers and my most steady stream of Adsense income comes from a site I built in 2006. I created some nice content (very nice and very original) back then and I just left it there.

I made only $10 a month from the site in the first year and after some very frustrating ups and downs, it’s gradually climbing up. Now, 4 years later, it’s averaging $600 a month. To be honest, I never actually spent much time on it at all. No link building nor frequent content updating no nothing and it’s now making me 600 bucks a month. Not much, but still.

Not only is it receiving large amount of steady traffic, new content are generally very well positioned in front spots in search engine results. The older the site, the more authoritative it can get from search engine’s point of view.

Time is the ultimate distinguisher between builders and spammers. Spammers come and go, hit and run. They are always impatient, looking to make the quick buck with a spammy site. Once they find it’s not profitable, they’ll stop renewing the domain after the 1st year. Google knows this too well.

So most of your sites would not actually start performing in terms of search engine traffic until at least 1 year after domain registration. Yet most people are too obsessed with quick results and never wait that long. They kill their sites just before they can make them decent money.

Be natural.

Google is becoming smarter and smarter. I would never go against them by challenging their intelligence and capabilities to identify spam (or partial spam).

Sites I intentionally optimize in title, description and content keywords as well as off-site link anchor texts never seem to get anywhere substantial. It’s boring and it’s chores. It’s not worth it. I can spend the same time and dollar bill in creating content that’s useful and exciting. Best of all, it’s much more fun that will keep you going!

Duplicate content is a myth.

While being original is absolutely a must in ultra saturated / competitive niches, duplicate content isn’t that big a deal in most niches.

Forget SEO. Start making friends and never stop creating stuff.

I’ve been doing SEO for 4 years and I can finally say, this is the ultimate SEO tip.

{ Comments on this entry are closed }

Argophilia – Eastern Europe Travel Portal

by Yang Yang on November 2, 2010

Phil was one of my best friends on the web and he has been very kind and helpful when I was just starting out. A few months back he invited me to work on a travel project that eventually landed as Argophilia. It’s a shame I was occupied by a lot of chores then and never actually contributed anything substantial to it.

Now you can see it’s becoming something real: http://argophilia.com/

And the news portal: http://www.argophilia.com/news/

They are simply awesome! Both the design and the content are exceptionally great. Hopefully they would take off soon as for now the only travel site targeting the Eastern Europe.

{ Comments on this entry are closed }

I have WAMP server installed on my local computer for PHP and MySQL development. After using it for a while, the MySQL installation folder has run up some seriously huge log files that are taking enormous amount of disk space. We are talking 10s of GB here. The file names are like ibdata1, mysql-bin.000017, etc.. It appears it’s because I frequently have large databases in and out by the ‘mysql’ and ‘mysqldump’ command, building up large stacks of data importing and exporting logs for data rollback and recovery or something.

Simply deleting the log files may result in problems such as being unable to start MySQL again. Tried that and I had to reinstall it to make it work again.

After some searching, I’ve found this query to solve my problem. Just execute it after you have logged in MySQL via command line – of course you will need the root privileges:

PURGE BINARY LOGS BEFORE '2036-12-12 12:12:12';

Something like that would purge and delete all the huge logs to free the disk. Just make the date time to be as sci-fi as possible so that all log files are purged.

{ Comments on this entry are closed }

It can be annoying when MySQL imports your UTF8 database (which contains exotic characters other than those in English) in the default character set of latin1_swedish_ci, jeopardizing the text content. It is also annoying when phpMyAdmin does the same and when you forgot to set the collation to utf8_general_ci for the new database which is very probably going to store utf8 characters.

Let’s fix this once and for all.

Just locate and open the MySQL configuration file my.ini and find the section [mysqld]. Add the following directive:

[mysqld]
character-set-server=utf8
collation-server=utf8_unicode_ci

Save to my.ini and restart MySQL demon. Now MySQL will use utf8 as the default character set when importing databases or creating new databases. The default collation of phpMyAdmin has also changed to utf8_general_ci.

{ Comments on this entry are closed }

Free PHP Business Directory Script

by Yang Yang on September 29, 2010

Simple PHP Script is a website scripts arsenal for Kavoir readers. My plan is to write many simple yet useful website scripts and release them in SPS for you to download and use. Some of them will be commercial and some of them will be free. The first script is a business directory website script in PHP and MySQL that I’m releasing free here.

Homepage layout

free php directory script screenshot
For the back-end administration control panel, use the demo account to log in.

How to download?

If you are interested in obtaining a copy of the script and use it for your own website, please sign up with our email list by the form in the right sidebar or the one immediately after this post.

After you have subscribed to the mailing list, not only can you download the script free, but you will also be notified of more free PHP website script releases in future.

What are the features?

This business directory script has a handy multi-step installation module to help you deploy the script on your server. PHP 5 is required. For now, you have to install it at the root of a dedicated domain or subdomain such as http://dir.example.com or http://www.example.com. You cannot install it in sub-directories such as http://www.example.com/dir.

It also comes with a user registration / contribution system and a full-fledged administration control panel. You can create and edit up to 2 tiers of categories. You and registered users can add business listings with business names, phone numbers, website URLs and postal addresses. You can choose to approve all the listings before they appear publicly or you can enable the users to instantly publish them on your site.

Paid inclusion is not available in this version yet. Nor is a usable template system. However these are already on my list of wanted features for this product.

Those who subscribes to Kavoir email list will receive all future upgrades for free. Just download the package again with the FreeCode that will be sent to your inbox after you have confirmed subscription.

Buy A Word Directory

Back a few years ago I also made this script: http://w3ec.com/ – the PHP link directory script that sells English words as links, $1 per letter. You can purchase a word and make it link back to your website. Feature the word on the homepage for an extra fee.

You can buy the script here: http://w3ec.com/script.php

{ Comments on this entry are closed }

PHP: Get Human Readable Time from Seconds

by Yang Yang on September 29, 2010

Linux timestamp is a number of seconds from the Epoch of Linux, large number of seconds. When you are counting the time interval between 2 times or 2 dates, the result is usually in seconds as well. Understandably, it’s everything but user friendly to just present the number of seconds to the users, e.g. 153297 s since last visit.

To display the time interval in a human readable format instead of in seconds, you can use the following function:

function getHumanTime($s) {
	$m = $s / 60;
	$h = $s / 3600;
	$d = $s / 86400;
	if ($m > 1) {
		if ($h > 1) {
			if ($d > 1) {
				return (int)$d.' d';
			} else {
				return (int)$h.' h';
			}
		} else {
			return (int)$m.' m';
		}
	} else {
		return (int)$s.' s';
	}
}

This is what I used for Usable Databases to display length of time since the user’s last visit to a certain page. d indicates day, h hour, m minute and s seconds. This function requires a number of seconds as input and convert it into human readable time periods such as x hours or x days.

{ Comments on this entry are closed }

Regular Expression for Date and Time Strings

by Yang Yang on September 29, 2010

Often we need the users to enter a valid string of date or time in the form. But how do you validate the strings with regular expressions? In PHP, you can use these functions and regular expressions.

RegExp and function to validate against date string:

// Default: YYYY-MM-DD
function isDate($subject, $separator = '-') {
	return preg_match('@^\d{4}'.$separator.'(0[1-9]|1[0-2])'.$separator.'(0[1-9]|1[0-9]|2[0-9]|3[0-1])$@', $subject);
}

RegExp and function to validate against time string:

// Default: HH:MM:SS
function isTime($subject, $separator = ':') {
	return preg_match('@^(0[1-9]|1[0-9]|2[0-4])'.$separator.'(0[1-9]|[1-5][0-9])'.$separator.'(0[1-9]|[1-5][0-9])$@', $subject);
}

If you need to validate against a different format, just change the $separator.

Now that you have the functions to validate date and time, you can combine them to verify date time strings such as 2016-04-30 18:19:05:

function isDateTime($subject) {
	$subject_array = explode(' ', $subject);
	if (count($subject_array) == 2) {
		return isDate($subject_array[0]) && :isTime($subject_array[1]) || $subject == '0000-00-00 00:00:00';
	}
	return false;
}

At Form Kid, these are functions I use for fields that need validation of the date and time.

{ Comments on this entry are closed }

When I’m developing the online form creator that enables the users to create form fields that accept only certain type of numbers, I need to verify if a given string is a valid natural number such as 1, 2, 3, 4, …. I’m writing the code / functions in PHP but you can literally use the regular expression in other programming languages as well. I use the following function to distinguish strings if they are natural numbers or positive integers.

function isNaturalNumber($subject) {
	return preg_match('|^[1-9][0-9]*$|', $subject);
}

You can add for a leading plus sign as well:

^+?[1-9][0-9]*$

Regular Expression for Negative Integers?

Negative integers are –1, –2, –3, …. Just add a minus sign before the regular expression for positive integers:

^-[1-9][0-9]*$

Regular Expression for Non-negative Integers?

That is, 0, 1, 2, 3, 4, …. By a little help of the isNaturalNumber function, you can use this function to check if a string is a legal non-negative integer:

function isNonNegativeInteger($subject) {
	// @^(0|[1-9][0-9]*)$@
	if ($subject == '0' || isNaturalNumber($subject)) {
		return true;
	}
}

Or if you insist on using a regular expression:

function isNonNegativeInteger($subject) {
	return preg_match('@^(0|[1-9][0-9]*)$@', $subject);
}

PHP functions to check if a string is a valid integer?

Just use the above functions in combination or the native is_integer() function of PHP.

function isInteger() {
	return isNegativeInteger($subject) || isNonNegativeInteger($subject);
}

{ Comments on this entry are closed }

The strange thing is that the native empty() function of PHP treats a string of ‘0’ as empty:

$str = '0';
echo empty($str) ? 'empty' : 'non-empty';

And it will output ’empty’. Therefore if you need to examine if a string is truly an empty string with zero length, you have to use:

echo strlen($str) == 0 ? 'empty' : 'non-empty';

Or you can use this function:

function isNonEmpty($subject) {
	return !empty($subject) || is_numeric($subject);
}

Which checks if the input string $subject is a numeric value (which makes it non-empty) or if it’s non-empty with empty() function when it’s not a numeric value.

{ Comments on this entry are closed }

Auto-generated content by user searches

by Yang Yang on September 29, 2010

A not-so-commonly employed content strategy is to automatically generate custom content by user searches. For example, if you’ve got a popular blog, there will be a lot of users searching for things they want to find on your blog. It’s an obvious sign that they want you to write about them. While you are recommended to keep an eye on what they are searching so as to provide content accordingly, you can also make the blog automatically generate search results pages by the searching terms.

I tried to find some WordPress plugins that do this for us but was unable to find any. Basically, the plugin would record all unique user search phrases and present them on a page as a list for the search engines to index the results pages with the custom page titles.

You should use the search term prominently in the page title and in the h1 tag. After the search engine has indexed the search results pages, you will have a lot of custom content pages AND best of all, they are exactly what users and potential visitors want to read. I have seen pretty exciting increase in searching traffic for my quotes site after I have implemented the strategy. The quotes search automatically generates a lot of custom pages by the searching phrase. What the user is searching is usually stuff that’s hard to come by in other sites or search engines so Google is pretty hungry in indexing these pages.

{ Comments on this entry are closed }