Note: I’ve taken a manual implementation for a PHP site for example. The following Basic On-Site Optimization Techniques might vary depending on the website type, CMS, etc.
Basic On-Site Optimization Techniques – One Page / On Site SEO Techniques
- Setting a preferred Domain in Google Webmaster Tools
- Setting Geographical Target
- Creating and Inserting an XML sitemap
- Meta Tag Optimization
- Microdata Implementation
- Image Optimization
- Leverage Browser Caching
- G-Zip compression
- 301 Redirection
- Specifying Canonical links
- Redirecting Multilingual International sites according to the country
Basic On-Site Optimization Techniques – Setting a preferred Domain in Google Webmaster Tools
It is required to choose between the www version and non-www version of your website. Unless you specify this, Google will consider both of them as the seperate website and all the authority and ranking will be splitted between the two. There is also a danger of duplicate contents.
To eliminate this we need to specify the preferred domain in the webmaster tools. You may need to verify ownership of both the www and non-www versions of your domain. Because setting a preferred domain impacts both crawling and indexing, we need to ensure that you own both versions.
Note: Once you’ve set your preferred domain, you may want to use a 301 redirect to redirect traffic from your non-preferred domain, so that other search engines and visitors know which version you prefer.
eg:-
<?php
if (substr(getenv(‘HTTP_HOST’),0,3) != ‘www’)
{
header(‘HTTP/1.1 301 Moved Permanently’);
header(‘Location:http://www.’.$_SERVER[‘HTTP_HOST’].$_SERVER[‘REQUEST_URI’]);
}
?>
Setting Geographical Target:
In the Google webmaster tool there is an option to set the geographic target for your website.
Just set the geographical target to your preferred country so that Google will prioritize yor website for your preferred location.
Creating and Inserting an XML sitemap:
It is always recommeded to create and insert a Sitemap for your website so that the Google crawlers will find it much easier to fetch and index your website. You may create an XML sitemap for free using any online sitemap creation websites for free.
eg:-
Meta Tag Optimization
This is the first thing to do when you start on page optimization. After doing the keyword research , it is time to implement the targeted keywords on your website. It is not about going for the high competitive keywords with high search volume which is more unrealistic, but to go for the long tail versions with fair amount of search volume which will be more easier to achieve.
When this is done properly, you may find it much easier to take control of high competitive keywords later on.
The two main meta tags that you need to focus on are the Title and Description Tag. Put your main keywords in the Tile tag not more than 70 char and write a human readable description in the Description tag not more than 156 char.
Microdata Implementation
Including microdata in your website enables search engines to understand the information on web pages and provide richer search results in order to make it easier for users to find relevant information on the web. Microdata can also enable new tools and applications that make use of the structure.
eg formats :-
Open Graph Protocol (OGP ) format:
<html xmlns=”http://www.w3.org/1999/xhtml” xmlns:og=”http://ogp.me/ns#” xmlns:fb=”http://www.facebook.com/2008/fbml”>
<meta property=”og:title” content=”” />
<meta property=”og:type” content=”website” />
<meta property=”og:image” content=”” />
<meta property=”og:description” content=”” />
<meta property=”og:site_name” content=”” />
<meta property=”og:url” content=”” />
Schema.org format:
<body>
<div itemscope itemtype=”http://schema.org/xyz”>
<span itemprop=”name”> </span>
<span itemprop=”description”>
<span itemprop=”makesOffer”> </span>
</span>.
</div>
</body>
Refer the following links for indepth understanding:
http://ogp.me/
http://schema.org/
You may use the below microdata validators to validate the microdata of your website.
http://www.google.com/webmasters/tools/richsnippets
https://developers.facebook.com/tools/debug
Image Optimization
People prefer resposive websites. They don’t like to wait. If the website takes forever to load then there is a chance that the viewer might leave the site. One of the reason for this is non-optimized images.
If the images are not optimized for the web, it will result in more load time. To eleminate this it is recommended to compress the images using image editing softwares such as Photoshop and then upload to the website.
Leverage browser caching
One way to improve the load time of a website is to enable the browser caching. By doing so, we can specify the expiry time for the website elements such as images, flash etc so that it will be saved in the user’s computer till the expiry date. And so if the user access the website later on, the browser will load items from the cache and thus will load much quicker.
The only thing to worry about this technique is the frequency in which the website will be updated. If we set a longer expiry time for the elements, and if the website gets updated, there is a chance that, user might not be fed with the updated website.
eg:-
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg “access 1 year”
ExpiresByType image/jpeg “access 1 year”
ExpiresByType image/gif “access 1 year”
ExpiresByType image/png “access 1 year”
ExpiresByType text/css “access 1 month”
ExpiresByType application/pdf “access 1 month”
ExpiresByType text/x-javascript “access 1 month”
ExpiresByType application/x-shockwave-flash “access 1 month”
ExpiresByType image/x-icon “access 1 year”
ExpiresDefault “access 2 days”
</IfModule>
## EXPIRES CACHING ##
// paste the above coding to htaccess file //
G-zip compression
You can decrease the website loading time by implementing G-zip compression.
eg:-
<?php if (substr_count($_SERVER[‘HTTP_ACCEPT_ENCODING’], ‘gzip’)) ob_start(“ob_gzhandler”); else ob_start(); ?>
//paste this code on top of the index page(only)//
301 Redirection
301 redirect is the way to redirect the traffic of one site or page to another site or page permenently.
This way you will not use your old clients and potential customers.
http://www.rapidtables.com/web/tools/redirect-generator.htm
How to do 301 redirect in PHP ?
If you want to redirect a single page to another location then put the following code in the old page which have been moved.
eg:-
<?php
header(‘HTTP/1.1 301 Moved Permanently’);
header(‘Location: http://www.new-domain.com/new-file-name.php’);
?>
Specifying Canonical links
Link canonicalization is one way to manage duplicate contents. If the website is having pages having same contents, then Google might consider them as duplicate content which will hurt the website. By specifying canonical link, you are telling Google which page is real which one is copied.
Add a rel=”canonical” link to the <head> section of the non-canonical version of each HTML page.
To specify a canonical link to the page http://www.example.com/product.php?item=swedish-fish, create a <link> element as follows:
<link rel=”canonical” href=”htt#31b5dfp://www.example.com/product.php?item=swedish-fish”/>
Copy this link into the <head> section of all non-canonical versions of the page, such ashttp://www.example.com/product.php?item=swedish-fish&sort=price.
Redirecting Multilingual International sites according to the country
http://www.lgr.ca/blog/2011/11/geolocation-click-redirection.html
eg:-
<?php
$country_code = $_SERVER[“HTTP_CF_IPCOUNTRY”];
if ($country_code==”UK”) {
$link = ‘Insert UK Link’;
}
elseif ($country_code==”FR”) {
$link = ‘Insert France Link’;
}
elseif ($country_code==”DE”) {
$link = ‘Insert Germany Link’;
}
else {
$link = ‘Insert Default Link’;
}
header(“location:$link”);
exit;
?>