How to do SEO for a website

First of all, make sure your website is known by google. Type this command to see what your website looks like in google:

 site: yourwebsite.com.au

How to improve your website weight?

Second, focus on three things: title, keyword and description. Do not think too much on this part, just think how to write a good article. Make sure they are attractive.

Third, content. make sure your content is latest, good quality, do not copy content from others.

Forth, links. links either other sites point to your site or your site points to other sites. In wordpress, pingback and trackback is good notification for it. The contents of the other sites and your site should be similar or has connection.

How to improve visits? 

First, make content attractive.

Second, get good keywords for your content. Google trend is a good start place. However, popular keywords have many competitions, so try some tail keywords is a good combination.

Third, your domain name can express what your site is doing.

Forth, your site speed is fast. Generally visitors will lose interest if the site slow than 3 seconds.

Fifth, coding. Try make javascript and css loading from external links and use meaningful html tags to represent content. For example, image has proper alt, title and paragraph to use <p> tag etc.

Below is a python script which can help you have a check on your single post’s keyword quality. It is just an example to explain more about SEO. In real word, there are many plugins to do such kind of work.

 

import urllib2
from BeautifulSoup import BeautifulSoup
import re
from sets import Set

def keywordChk(keywords, url):
    response = urllib2.urlopen(url)
    text = response.read()
    soup = BeautifulSoup(text)
    content = soup.findAll("p")
    c1=''
    word_count = {}
    total = 0

    #get all words 
    for c in content:
        c1+=''.join(c.findAll(text=True))
    splitter=re.compile('\\W*')
    words=[s.lower() for s in splitter.split(c1)]
    #keyword frequency
    for word in words:
        if word in keywords:
            if word not in word_count:
                word_count.setdefault(word, 0)
            word_count[word]+=1
    for k,v in word_count.items():
        print 'fequency of keyword {} is {}'.format(k, float(v)/len(words))
        total+=v
    #total keyword frequency
    print 'total key word frequency is {}'.format(float(total)/len(words))

    #is keyword frenquency good?
    if float(total)*100/len(words) >= 2.0 and float(total)*100/len(words) <= 8.0:
        print 'keyword frequency is good'
    else:
        print 'keyword frequency is bad'

keywords = Set(['word1', 'word2', 'word3', 'word4'])

keywordChk(keywords, url)