Webmaster Blog

Web Design, Web Hosting, SEO, Graphic Design

11 December
0Comments

Government plans to make postcode data free in 2010

Postcode data to be made freeThe UK government has announced plans to give everyone free access to postcode data. At present, commercial organisations use the Postcode Address File (PAF) that ties post codes to addresses and organisations that want access to these datasets can only do so via paid, third-party services like Postcode Anywhere, Simply Postcode and Quick Address to name some of the most popular.

The move is part of the Government’s ‘Smarter Government strategy’ to utilise more technology and the web in order to transform official services. This is in addition to the recent government pledge for a further £30m cash injection to help another one million Britons get access to the internet for the first time.

Postcode look-up and address auto-fill services have become increasingly popular in recent years particularly with businesses and webmasters as they:

  • allow end-users to quickly and accurately enter their full address
  • ensure the address input is free from errors
  • allow addresses to be completed from partial information
  • make sure all addresses adhere to a standard layout enabling more accurate database filtering
  • help to avoid duplicated entries in databases

From a webmaster’s perspective, this can be a crucial service especially when considering the administration of databases containing tens of thousands of customer details which includes addresses.

The postcode information is set to become free in April 2010 and will be welcomed by many businesses, especially those looking to cut expenses within the current financial climate. Up until now, the cost of third-party postcode services would be on average £50 per 1,000 address look-ups so these plans are set to save businesses hundreds if not thousands of pounds over the course of the year.

Within these plans, the government has stated it would start “consulting on making Ordnance Survey mapping and postcode datasets available for free reuse from April 2010″ and a spokesman for the Ordnance Survey said the consultation is likely to begin before Christmas.

“It’s a chance for anyone who has views on what can be given away to make those views known,” he said. ”It’s more a question of how not if,” he said. “It’s something that’s going to be happening.”

The news is in stark contrast to recent events most notably in October this year when Royal Mail took legal action against many websites that resulted in the termination of the access they had to such data. These websites that used the postcode feed included Job Centre Pro Plus, HealthWare (to locate nearby pharmacies and hospitals), PlanningAlerts.com (to monitor planning applications) and Straight Choice (to find out who sent political leaflets).

A recent BBC interview with Harry Metcalfe, the man who helped sites get at postcode data, said he was “cautiously optimistic” about the decision to open up the OS data sets. He went on to say “If the right data is released in the right way, this will be a positive development”.

Overall, this change is welcomed by webmasters and will make working with address and postcode data quicker, simpler and now cheaper.

16 November
0Comments

Top 10 basic SEO tips – Part 1

Introduction

magnifying_glass

I have read many posts from the internet giving advice on the best search engine optimisation (SEO) techniques to improve your website’s ranking and having successfully carried out a number of SEO campaigns for various companies,  I thought it’s about time I share some of the things I have learned along the way.

Firstly, let me state that this tutorial is intended for the SEO beginner and the following advice may seem obvious to those with optimisation experience. Saying that, optimisation is constantly evolving so there may still be some useful tidbits even for the experienced SEOs.

This is the first installment of a three-part series. The second and third parts will cover intermediate and advanced SEO techniques so keep watching this space!

So on to the SEO advice… All these tips are considered on-page optimisation which means that they involve making amendments to your website alone in order to improve your position in the search engine result pages (SERPs). They can all be done by yourself and you should notice results relatively quickly.

1. Do your research

seo-tips-basic-researchThis is probably one of the most obvious pieces of advice I can give you yet it can often be the most overlooked. Before you begin any form of optimisation, make sure you know a lot about your chosen industry. Think about what phrases people are likely to type in to find you and then use the Google Keyword Tool (https://adwords.google.co.uk/select/KeywordToolExternal) to find out how many people use these search phrases on a monthly basis. There’s no point investing your time and effort optimising a particular search phrase if nobody uses it.

Try to avoid using industry jargon and acronyms when selecting phrases for optimisation. It may be obvious to you what a ‘model 1456D widget’ is but would your visitors know that and more importantly would they know to type this into a search engine? It’s generally better to go for more generic phrases as these are more likely to have higher search volumes. Avoid phrases that are too generic as the competition will most often be very fierce and therefore much more difficult to achieve the results you’d like.

2. Page titles

seo-tips-basic-titleThe page title is arguably the most important factor for SEO as this is where you tell visitors and search engines alike exactly what the page is about. The page title firstly appears right at the top of your internet browser but is also the part that is displayed as the blue link in search engine results.

In HTML, the title of a page is denoted by:

<title>Your page title</title>.

First and foremost, make sure that the title accurately reflects the content of the page (stuffing keywords into the title that have nothing to do with the page content could soon land you in trouble). The main trick to setting effective titles is to think about what the page is about and what good keywords would be relevant. You then make sure that you have your keywords incorporated within the page title.

A common mistake I’ve seen is the inclusion of company names within page titles such as “Web design – vermadesign.co.uk” and “Web Design | Verma Design”. Unless you have a well known brand, it is not advisable to display your company name. People generally won’t search using your company name and so you’re wasting space that could be put to better use such as “Web Design | UK Website Development”.

In terms of the maximum length of page titles, I would recommend you don’t exceed 65 characters for any title. This will ensure your titles are displayed in Google and Yahoo in their entirety and nothing gets truncated.

Ensure all the page titles within your website are different. You should never have two pages that cover the same content and if you do, you should consider combining them. If you have a website that contains thousands of pages, there is a simple way to detect duplicates via Google Webmaster Tools (see 10).

3. Meta description

seo-tips-basic-descriptionThe meta description is a tag that was originally implemented to allow you to write a brief description of the page content. It almost acts as a blurb or snippet of the page content itself and expands on the page title much like a books.

Meta descriptions are denoted in HTML as:

<meta name="description" content="Description of the page content
goes in here..." />

Search engines will often use your description as the black text that appears just under your page title in SERPs (see image above). Your description therefore is another area where you can add relevant keywords to improve your ranking. If you look at the image above, you can see that not only have keywords been bolded in the title, but also the description which shows how the description can helping reinforce your keywords. Search engines do reserve the right to create their own snippet based on the content of your page if they feel it is more suitable for visitors. It’s important that you do not spam the description with keywords as a) it is likely to put off potential visitors. Remember, your description will be displayed in the SERPs b) search engines may disregard you description altogether and use their own generated description if they feel yours is not suitable.

In terms of the maximum length of a Meta Description, I’ve read many people say it’s about 255 characters, however, in my experience I always aim to keep them within 150 characters as search engines tend not to display above and beyond this.

4. Meta keywords

seo-tips-basic-titleThe Meta keywords tag was originally implemented to help webmasters indicate a page’s relevant key phrases to search engines. This was before search engines were capable of accurately determining the key phrases from the content for themselves.

The Meta keywords tag is denoted in HTML as:

<meta name="keywords" content="keyword1, keyword2, keyword3,
keyword4" />

Although the tag is called keywords, you are not limited to single words only and in fact you can string together long phrases as long as you separate each grouping by a comma. So an example could be:

<meta name="keywords" content="optimisation, seo, search engine
optimisation" />

You can have any number of keywords and not just limited to single words, you can also add phrases as long as they are separated by a comma. Ensure you keep the total length of your keywords within 256 character (including spaces) and try to avoid duplicating the same word again and again. An example of overuse of a keyword could be:

“cars, cheap cars, affordable cars, white cars, black cars, grey cars, big cars, small cars, fast cars, shiny cars, loud cars, vintage cars, muscle cars”

The above example contains the keyword ‘cars’ a total of 13 times in 25 words. This is considered an overkill and you should aim to use a single word no more than 6 times in the entire keyword tag. There is nothing stopping you varying the phrases such as using ‘autos’, ‘vehicles’ or ‘automobiles’ instead.

Google no longer relies on meta keywords to determine key phrases due to the high level of abuse from spammers. Instead, Google determines the keywords via the inbound links and page content. Other search engines like Yahoo and Bing have shown signs of still using meta keywords in their algoritms although not nearly as much as originally intended. Never-the-less, for this reason, meta keywords  can still be quite a benefit.

5. Headings

seo-tips-basic-titleHeadings help separate your content to make it easier to read and can be very useful in SEO as search engines place an emphasis on headings. This is because headings provide a description of the ensuing content within a short summary. This means that they are usually rich with keywords which search engines can make use of. Headings label your headline so that search engines will recognise it as “important” on your web page.  The heading tags also make your headline bolder so it will stand out to your readers.

The Meta keywords tag is denoted in HTML as:

<h1>Top 10 basic SEO tips</h1>
<h2>5. headings</h2>

There are a variety of heading tags you can use such as (h1,h2,h3). The importance of the heading is denoted by the number with 1 being the top-level. Effectively, h1 is a sub-heading of the main page content, h2 is a sub-heading of h1 and h3 is a sub-heading of h2.

You should try to incorporate you key phrases within your headings so to place an emphasis on what the page is about. Ensure the headings are relevant to the content and that you don’t just stuff keywords in there. Remember, what you write should be for a human to read, not a search engine.

Aim to use more specific key phrases in your headings as you’re less likely to yield good results with generic ones due to the number of other websites that will be using the same headings as you.

If you have a lot of content on a page, you should try to separate you content into manageable chunks using headings. Use the sub-headings to tell your readers what the page is about and entice them in to read on.

You should only have one headline on a page which is the top of your page hierarchy, for this reason, you should only use one h1 tag per page. Having multiple h1 tags and encapsulating the entire page content within a h1 tag is discouraged and in some extreme cases can even lead to a search engine penalty.

Make sure your h1 tag contains your relevant keywords and if you have a lo of key words/phrases, spread them between the page title and h1 tag. There is no harm in having the same h1 tag as the page title but you can target more phrases if you ensure they differ.

While search engines are reputed to put some weight on a heading between h3 tags, you should focus more on h1 and h2 tags as these will give the greatest benefit.

Read part 2 of our Top 10 basic SEO tips

22 October
3Comments

Create your own URL shortener

Why do we need URL shortening services?

URL text being squashed in a viceStudies have shown that if a URL is longer than 30 characters, many consumers are likely to be put off especially if faced with having to type it in manually. In addition to this, longer URLs are exposed to a greater risk of being input incorrectly. This can cause massive problems when sharing your information especially when sharing links via non-computer based methods such as printed text or via the telephone.

To combat this problem, URL shortening services were introduced. URL shortening services do exactly what they say on the tin; they convert long, complex URL strings into shorter more manageable ones. There are now hundreds if not thousands of free services available for this purpose.

One thing that struck us whilst using one of these services was just how simple it would be to recreate our own. We’re aware that there are many free scripts available to download that will provide URL shortening functionality, however, since it is so simple to recreate, it makes for a great learning exercise.

How do URL shorteners work?

For a demo, take a look at our URL shortening script.

So in order to create our own, we need to understand what is happening under the hood of a URL shortening service. You’d be forgiven for thinking that these services use some form of complex string compression and encryption, however, they actually work in a much simpler way. When the user enters their ‘long’ URL, the long link is added to a database and assigned a unique ID (the primary key). It is this primary key that is then used to retrieve the original long URL and redirect the user to that page.

Let’s use an example. Imagine we have the long URL, http://www.vermadesign.co.uk/blog/2009/10/create-your-own-url-shortener/ which we input into the URL shortener and submit. The URL is added to the database and assigned a unique ID. For arguments sake, I’ll assume this is a brand new database and therefore this URL is the first. The ID returned is therefore ’1′.

The short URL returned could therefore be something like http://www.vermadesign.co.uk/?1. You can see that this is a much shorter URL than the one before.

In order to retrieve the long URL from the short version, when a user visits the short URL, a script located at http://www.vermadesign.co.uk/ will check whether a parameter (in this example ’1′) has been declared (declared using ‘?’) and use this parameter to retrieve the long URL. This can easily be achieved with only several lines of code in PHP.

Before we proceed with developing the URL shortening scripts, we need to understand how to further reduce the URL length. You my have noticed many other URL shortening services have parameters that contain both letters and numbers. By using letters as well as numbers, we can further reduce the length of the shortened URLs.

First we need to understand how the code is generated . For this example, we will learn about Base 36. Our normal method of counting is done in denary (base 10) – that means that each digit has ten possibilities 0 to 9. By converting to a higher base, we reduce the number of digits required to represent the same number. Base 36 works in the same way as Base 10 in that it starts with 0-9 however, instead of moving to the next digit, the letters a-z can then be used i.e. x..y..z..10..11..12..13..14..15..16..17..18..19..1a..1b..etc.

So the number 1,000 can be represented as ‘qr’ in base 36.

27 x 36 = 972 (27th character in Base 36 is ‘q’)
28 x 1 = 28 (28th character in base 36 is ‘r’)
qr = 1000

As you can see, by switching to base 36, the 1,000th short link will actually be two characters shorter using this method.

There are many far more effective methods of reducing the short URL further, however, for simplicity, I would suggest starting with this method.

You may be wondering why I do not switch to a higher base 36 as it would further reduce the URL length. The reason I have opted for base 36 is because all the digits can be represented by either a letter or number and are therefore perfectly safe to use in a URL. If you were to use a very high base, some digits may be represented by special characters which in turn may cause issues with older computers or web browsers.

How to make your own URL shortening script

In order to proceed you need to ensure you have a server with MySQL and PHP installed. If you don’t, I recommend downloading an all-in-one test server such as XAMPP. This part of the tutorial assumes you have a basic knowledge of HTML forms, PHP and MySQL.

The first step is to create the database table:

1
2
3
4
5
6
7
CREATE TABLE IF NOT EXISTS 'url-shortener' (
  'url_id' int(10) NOT NULL auto_increment,
  'url' varchar(500) NOT NULL,
  PRIMARY KEY  ('url_id')
);
 
INSERT INTO url-shortener ("url") VALUES ("http://www.vermadesign.co.uk/blog/2009/10/create-your-own-url-shortener/");

The above MySQL statement will create a very basic table. You may want to consider increasing the length of the url field. I have opted for 500 in order to save space. The second part adds an example long URL so we can test the next script.

Next we need to work on the PHP redirect script. The function is very simple, the script will check whether a parameter has been set, convert from base 36 to 10, look up the long URL in the table and redirect to that URL. If no long URL is found, a ’404 Page not found’ error is returned.

The toughest part of this script seems to be converting between base 10 and 36, however, PHP has a very simple function for converting between bases called base_convert(). So putting it all together, we get the following:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Get short link code
$request = $_SERVER["QUERY_STRING"];
 
// Connect to MySQL database
 
// Convert short link parameter from base 36 to into the URL ID which is ase 10
$url_id = base_convert($request,36,10);
 
// Search the database for a long URL given the ID
$query = "SELECT * FROM url-shortener WHERE url_id='".$url_id."'";
$data = mysql_query($query);
 
// Count number of records matching the above query - will only ever be 0 or 1 as the ID is unique
$count = mysql_num_rows($data);
 
// if a long URL exists in the database given the ID - if $count equals 1 the below if statement returns true
if($count) {
	// Fetch MySQL data
	$info = mysql_fetch_array($data);
 
	// Close database connection
 
	// Redirect to long URL
	header("HTTP/1.1 301 Moved Permanently");
	header("Location: ".$info['url']);
	exit();
} else {
	// Close database connection
 
	header("HTTP/1.0 404 Not Found");
 
	// Display 'page not found' page
	echo "404 Page not found";
	exit();
}

Once created, save as index.php and store in your domain’s root folder. You should then be able to see the script in action by typing http://www.mydomain.com/?1 (substituting mydomain.com for your domain name) into the address bar. Also try using a parameter of 2 or above and you should find a 404 page not found error is returned instead.

The last part is creating the form to input a URL to shorten and the script to add it to the database. Start by creating a simple form with a textbox named ‘url’ and a submit button like below:

?View Code HTML4STRICT
1
2
3
4
5
6
<form id="urlform" action="create-short-url.php" enctype="application/x-www-form-urlencoded" method="post">
 
URL:
<input id="url" name="url" type="text" />
<input class="button" name="submit" type="submit" value="Shorten" />
</form>

Next we’ll create the create-short-url.php script to process the form data and add the URL to the database. This script is much simpler than the last one, we need to gather the URL inserted into the form and add it the the database. The ID from the newly inserted URL is then converted into base 36 and the short URL is constructed and output to the user.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Collect form data
$url = $_POST['url'];
 
// Connect to MySQL database
 
// Add URL to database
$insert_query = "INSERT INTO url-shortener (url) VALUES ('".$url."')";
mysql_query($insert_query);
 
// Get the ID of the recently inserted URL
$url_id = mysql_insert_id();
}
 
// Close database connection
 
// Generate the base 36 short code from the URL ID
$short_code = base_convert($url_id,10,36);
 
// Display the newly formed short link ensuring you substitute mydomain.com for your domain name
echo "Short URL is http://mydomain.com/" . $short_code;
exit();

Put it all together and we have now finished our very basic URL shortening service.

Additional tasks

The above example shows you how to make a very simple URL shortener, however, many features have been left out including security measures to keep the explanation as simple as possible.

Below are some suggestions of how you could further develop and improve the above script.

  • Add additional fields in the database table so you can log the IP address of the URL submitter and date and time the URL was submitted. You could even set a field to dictate how long the short URL remains active
  • Validate the form to check the structure of URL before adding to database. This will help reduce the strain on the server and help to reduce broken links
  • Check if the URL already exists in the database and if so, return the existing short URL
  • Properly escape the URL to avoid SQL injection. This is very important for security
  • Edit your .htaccess and use mod_rewrite to remove the required ‘?’ from the short URLs as well as set the default domain to the non-www. version. Doing both of these will save 5 characters on the short URL

If you have any questions relating to this article or suggestions of how we can improve it, please feel to leave us a comment below and if you enjoyed reading it, please help us share by using the links below.

22 September
1Comment

Welcome to Webmaster Blog!

Web Design and IT SupportWelcome to the VermaDesign Webmaster Blog. Here we are aiming to bring you the latest information and tricks for a variety of web services such as web hosting, web development, graphic design and search engine optimisation.

We’re looking to build a community where people can learn anything and everything about web development and want to see this website grow into what webmasters consider as the first place to visit when searching for information and advice. We realise this cannot be done by ourselves alone and therefore ask everybody to contribute whatever they can by sharing what they’ve learnt, becoming authors and commenting on the posts.  To encourage our visitors to participate, we have even decided to make all comments on this blog DOFOLLOW. All comments must still go through the usual approval process before they get added so please make sure your posts are relevant and add value to the discussion.

Have a look around and please feel free to share your thoughts.