Cheating Google

21 August 2009

Do not try and cheat Google as they will penalise and may even blacklist your website.

Things that Google sees as cheating:

  • Duplicate content
  • Text on the same colour background
  • Buying links to your website
  • Really small text so that users can't read it (yet Google will still read it)
  • Over repetition of keywords e.g. Cars, car manufacturers, fast cars, cheap cars, top range cars, good cars, sports cars, etc...

Permalink     Comments (0)     Trackbacks (0)

Share this on Facebook  Share on Twitter   Google  Yahoo  Technorati  Reddit  Digg

Friendly URLs

20 August 2009

People often call these search engine friendly URLs - but currently Google is not actually using the URLs as a method of web page optimisation (apparently) - But it's more than likely that it will be a factor in the future.

Google can't read really long query strings - index.php?category=blog&type=entry&start_page=12&total_pages=27&viewer_id=user9&search_term=google-searches etc...

Friendly URLs are more for the user to be able to view what page they're about tobe viewing - e.g. Tell the user what's on the next page /about-search-engines/ etc...

If a Google search term is then found within the page's URL it will also bold this word just to show that Google has found this as well.

Permalink     Comments (0)     Trackbacks (0)

Share this on Facebook  Share on Twitter   Google  Yahoo  Technorati  Reddit  Digg

What every website should have

18 August 2009

A sitemap that can be submitted to Google - allowing Google to index every page on your website.

A custom "404 page cannot be found" page - making this useful would also be a good way to keep users on your website, e.g. A site search, a "did you mean".

Alt text for all images.

Useful link text for every hyperlink on your website. Don't use "click here" use "Find out more about Search Engines".

An analytics application that can track users activity on the website and so show you which parts need improving to increase the visitors chances of reaching a goal (newsletter sign-up, make a sale, contact us, etc...).

The most important  text at the top left - Google, like humans, reads left-to-right, top-to-bottom and so the first thing it reads should be the most important thing.

Permalink     Comments (0)     Trackbacks (0)

Share this on Facebook  Share on Twitter   Google  Yahoo  Technorati  Reddit  Digg

Sending a trackback

17 August 2009

Sending a trackback will take place in the admin side of your website when you submit a blog entry.

In your admin area you will often have a field to enter trackback URLs.

When you then click submit a trackback will be sent to each of these trackback URLs.

The receiving trackback URL will then send you a success or error response to notify you of the trackback status.

Once the blog entry has been submitted I save all the blog data to the database, along with the trackback URLs that you want to send to.

I personally then have a separate page that I then go to which carries out the trackbacks after getting all the trackback URLs back out of the database where we just saved them.

Here's my code which sends the trackbacks:

if (isset($_REQUEST['id'])) //Get the id of the blog having the tracback sent to it

include "database/connectdatabase.php"; //Connect to the database
include "Services/Trackback.php";

$query = "SELECT blog_id,description,ping_links,title,link FROM blog WHERE live = 'on' AND id = '" . $_REQUEST['id'] . "'"; //Get the blog information to send
$result = mysql_query($query);
$row = mysql_fetch_array($result);

$site_query = "SELECT name FROM site WHERE name <> '' LIMIT 1";
$site_result = mysql_query($site_query);
$site = mysql_fetch_array($site_result);

$title = $row['title']; //The title of the blog
$excerpt = $row['description']; //The blog description

$url = “" . $row['link'] . "/"; //The blog URL

$blog_name = $row['title']; //Not too sure on the difference between this and the $title variable, but I've put the blog title again

$trackback_url = "" . $_REQUEST['id'] . "/"; //The trackback URL for this particular blog entry – although I don't think this is used on outgoing trackbacks

$ping_servers = explode("n",$row['ping_links']); //From the trackback URLs it separates them (one per line)

foreach ($ping_servers as $server) //Loop each of the trackback URLs

echo "Value: $value<br />n"; //Show the trackback URL we're sending to
$trackbackData = array( //Set the trackback data
'id' => "",
'title' => $title,
'excerpt' => $excerpt,
'url' => $url, //My blogs URL
'blog_name' => $blog_name,
'trackback_url' => $server

//new trackback instance
$trackback = new Services_Trackback();

//set opbject properties
foreach ($trackbackData as $k => $v)

$trackback -> set($k, $v);

//send trackback
$ret = $trackback -> send();
if (PEAR::iserror($ret))

echo "<strong>" . $server . "</strong> ping failed" . $ret -> getMessage() . "<br />"; //Trackback failure error
echo "<strong>" . $server . "</strong> ping successful<br />";
//Trackback sent successfully



echo "<p>An error occurred, pings not sent</p>"; //Could not send trackback


Permalink     Comments (0)     Trackbacks (0)

Share this on Facebook  Share on Twitter   Google  Yahoo  Technorati  Reddit  Digg

Setup trackback - Trackback page

16 August 2009

The trackback page should carry the blog id as a variable. If there is none then we don't want to carry on as the database query may throw back errors.

On the tracback page we want to take the blog id, search the trackback table to make sure that a trackback for this blog id and from this website doesn't already exist (as we don't want spammers attacking us).

If there are no current tracbacks from this website on this particular blog then we will add it to the database and send a message back to the originating website to say that we have added it successfully.

//Allow trackbacks
$trackbackData = array(
'id' => $_REQUEST['id'], //id of blog receiving the trackback
'title' => "",
'excerpt' => "",
'url' => "",
'blog_name' => "",
'trackback_url' => ""

//include class
include "Services/Trackback.php";

//new trackback instance
$trackback = new Services_Trackback();

//set opbject properties
foreach ($trackbackData as $k => $v)

$trackback -> set($k, $v);


if ($trackback -> receive()) //If this page has received a valid trackback request

echo $trackback -> getResponseSuccess(); //Send a success message back to the originating website

//Save trackbacks in database
global $trackbackData;
$postData = $trackbackData['nospam'];
$data = $postData;

include "database/connectdatabase.php"; //Connect to your database
$query = "SELECT id FROM trackbacks WHERE url = '" . $data['url'] . "' AND blog_id = '" . $_REQUEST['id'] . "'";  //Check if this website has sent a trackback request to this blog entry already
$result = mysql_query($query);
if (mysql_num_rows($result) == 0)

//save it to database
foreach ($_POST as $key => $value)
$$key = addslashes(trim($value));
$string = $string . " " . $key;
$query = "INSERT INTO trackbacks (title,excerpt,url,blog_name,trackback_url,blog_id,date) VALUES ('" . $_POST['title'] . "','" . $_POST['excerpt'] . "','" . $_POST['url'] . "','" . $_POST['blog_name'] . "','" . $_POST['trackback_url'] . "','" . $_REQUEST['id'] . "','" . date("Y-m-d H:i:s") . "')";
$result = mysql_query($query);



echo $trackback -> getResponseError(); //Send back an error response if it was not successful


Once all the code is on the correct pages you will be able to receive trackbacks and then display them on your blog page.

Permalink     Comments (0)     Trackbacks (0)

Share this on Facebook  Share on Twitter   Google  Yahoo  Technorati  Reddit  Digg

Setup trackback - Blog entry page

15 August 2009

The blog page needs to show the trackback URL, for people sending a trackback to use, and also display the current trackbacks for this page.

Near the bottom of a lot of blog entries you'll often find a comments area.

Because trackbacks are another way of interacting with the page they're usually found around the same area as the commenting area.

It should show the current trackbacks – like this code that I use:

$track_query = "SELECT url,date,excerpt,blog_name,title FROM trackbacks WHERE blog_id = '" . $blog['id'] . "' AND url <> ''";
$track_result = mysql_query($track_query);
if (mysql_num_rows($track_result) > 0)

echo "<p>Current trackbacks to this blog entry are</p>";
while ($track = mysql_fetch_array($track_result))

echo "<p style="padding-left:30px;"><strong>" . display_string($track['title']) . "</strong> on <strong>" . display_string($track['blog_name']) . "</strong><br /> " . display_string($track['excerpt']) . "<br /><a href="" . $track['url'] . "" target="_blank" rel="nofollow">" . str_replace("http://","",$track['url']) . "</a></p>";



You will probably need to change some of the query string as you may not be passing in the same variables as I have already set.

$blog['id'] needs to be the id for the blog entry so that it only shows the trackbacks for that one blog entry.

Showing the trackback URL for a particular blog entry can be done by:

$site_url = “”;
$trackback_page = “trackback.php”;
$trackback_url = $site_url . $trackback_page . “?id=” . $blog['id'];

As you can see because of the $blog['id'] variable, every blog entry will have a unique trackback URL address.

Permalink     Comments (0)     Trackbacks (0)

Share this on Facebook  Share on Twitter   Google  Yahoo  Technorati  Reddit  Digg

Setup trackback - Database

14 August 2009

Open phpMyAdmin or another database configuration application for your online database, and enter the following SQL query:

`id` int(11) NOT NULL auto_increment,
`url` varchar(255) NOT NULL,
`title` varchar(50) NOT NULL,
`trackback_url` varchar(255) NOT NULL,
`blog_name` varchar(50) NOT NULL,
`excerpt` varchar(255) NOT NULL,
`blog_id` int(11) NOT NULL,
`date` datetime NOT NULL,

This SQL query code will create the table “trackbacks” along with all the fields needed for our new functionality.

If you don't have any MySQL databases you will need to setup another method for holding the trackbacks. Maybe use random access files on your web server – just be sure to set the permissions correctly so that anyone can write to the file.

Permalink     Comments (0)     Trackbacks (0)

Share this on Facebook  Share on Twitter   Google  Yahoo  Technorati  Reddit  Digg

What is needed to add trackback functionality?

13 August 2009

In order for trackbacks to work on your website you need to check the following:

  • PHP version 4.3.0 or newer
  • MySQL database (preferable)
  • FTP access to your website
  • Pear trackback script

To find out whether you have FTP access you can either look at your web server’s control panel and create a new FTP account, or you can contact your web hosts direct for FTP details. If you don't have FTP access then you will not be able to add this script to your website, try asking your webmaster to try and set one up for you.

To find out which version of PHP your web server is running create a new PHP file and add the following code:


Upload this file and then open the page in a web browser and view which version of PHP your web server is running.

In the web server’s control panel you should also be able to setup a MySQL database which we will use to save all the trackbacks to your website.

If you do not have any MySQL databases that you can use then we will have to use a text file to hold the trackback information. In this situation you will need to change the implementation code accordingly.

If you haven’t already got the Pear trackback script you can download it from:

Unzip the folder on your local computer.

Open the unzipped folder and find a folder called “Services”.

The “Services” folder is the only one you need to upload, so copy it to your website area and upload it to your web server.

Permalink     Comments (0)     Trackbacks (0)

Share this on Facebook  Share on Twitter   Google  Yahoo  Technorati  Reddit  Digg

When do I use a trackback?

10 August 2009

When I want to write a blog entry I often think of a topic to write about, and then do a Google search “Topic of interest trackback”.

Notice the “trackback” in the Google search. It doesn’t always work – but quite often it will bring back blog entries of the same topic that allow trackbacks.

On a blog entry that allows trackbacks you’ll usually find a trackback URL, usually near the bottom of the page or often also near the “comments” area. If it’s not visible you can also view the website’s source code and look for the following piece of code:

<rdf:RDF xmlns:rdf=""
dc:title="How to run server side PHP scripts on my computer" trackback:ping="" />

rdf:about – The blog entry permalink
dc:identifier – Again the blog entry permalink
dc:title – The blog entry title
trackback:ping – The unique trackback URL for this blog entry

Change these 4 variables depending on the page/blog entry, but leave all the rest of the code as it is. The “<!--“ at the top of the code is commenting it out, so that when validating your page it still passes the W3C validations.

You may also see this code being called the trackback auto discover code.

I trackback as often as I can, as it’s always good to get my link out there on other people’s websites.

Permalink     Comments (0)     Trackbacks (0)

Share this on Facebook  Share on Twitter   Google  Yahoo  Technorati  Reddit  Digg

What is a trackback?

9 August 2009

A trackback is the exchange of hyperlinks between 2 blogs.

I write a blog entry called “Which is better, TypePad or Blogger?”

Next I write my opinion, facts about the 2 and a conclusion.

If someone else is writing a similar blog entry, they may find my blog entry and reference to it by placing my link on their blog entry.

When they submit their blog entry they will send a trackback ping to my blog entry saying “Joe Bloggs has written a blog entry and has referenced your blog entry”.

The trackback ping will be sent to a unique trackback URL.

My trackback URL will then send back either a success or error response to notify the originating website of the trackback's status.

When someone next views my blog entry they will see there’s a trackback from Joe Bloggs website, which they can then view and get Joe Bloggs’ opinion on the topic as well.

The trackback allows someone who reads my blog entry, and finds it interesting, to then go onto another blog entry, of the same topic/interest, and read their views/opinions.

Trackbacks are a great way to link build, get your link mentioned on a lot of different people’s website, get more traffic – and most of which is of interest because they took the time to read the original blog entry.

Permalink     Comments (0)     Trackbacks (0)

Share this on Facebook  Share on Twitter   Google  Yahoo  Technorati  Reddit  Digg