Get Help Ranking
Tim Hill SEO
How to SEOin2019
With me, Tim Hill

How to SEO your website code

This sounds techie but it doesn't need to be. However its essential we go there first because for a number of people using this guide they may have major issues, and that could include you!

Is your website reliant on Javascript?

There's an easy way to find out. Open a page on your website and make a note of some text content which appears in the main content. Not the title but a sentence from somewhere in the main body of the page.

Now:

  1. Find a blank space on the page and right hand click.
  2. From the small popup menu that appears left hand click on 'View Page Source'.
  3. Eeeeek!? Don't be phased. Hold down Ctrl and F at the same time and look for a small search box that will appear in the bottom left or top right
  4. Type in that text you noted earlier

Did you find it? OK we can SEO this page right now - scroll down to the next section on this page about code validation. Didn't find anything? That means your website has probably been designed with Javascript and you'll struggle.

Search engines can read Javascript pages but they are slow at doing it because they use a process known as second wave indexing. Here's how it works:

When you visit a page your browser (Firefox, Chrome or whatever)

  1. reads the source code, what you just searched
  2. renders the page - basically does the things the code tells it to which make it all lovely and pretty for humans and activates features such as pop up images and slide shows.

When a search engine visits your page they just read the page source code. They don't render the page. Later when they have some free time they will render the page. This secondary action is the second wave indexing.

If your page is 90% Javascript it won't action that type of code until it does its second wave index. This could be days, weeks or even months after its first visit and it is only then that the search engine discovers what content you actually have and what links exist to other pages on your website.

Further down the line when you make changes you might have to wait weeks again until search engines like Google actually acknowledge your edits.

If you have a Javascript driven website there is no need to abandon it but you will probably need technical help in ensuring that whatever is in the Javascript version also exists outside it.

Code checking for non techies

Search engines aren't sticklers for good coding. They'll do their best to root through your content no matter how many errors there are ... but why make like difficult for them?

Websites are usually made up of two main elements:

  1. HTML code - that's the source code you searched earlier.
  2. CSS code - this is code that tells browsers stuff like what color and size the text should be in different places, how wide that bit should be or what a link should look like.

You can check both of these online very quickly using the following free tools:

The chances are your website is not going to pass with flying colors because very often plugins like a Facebook like button throw errors. All you need to check is your side of things and reduce errors down to a minimum where you can.

To do so you might need some help from a programmer but don't sweat it too much. If your page just has half a dozen or so errors its not the end of the world.

I do get clients come to me who have hundreds of errors and it really is a lot of noise that the search engines could do without.

How poor code makes unhappy users and bad SEO

Coding errors can also create another issue. They can cause your website to display poorly in some browsers and there are so many different browsers out there that you can't possibly test them all.

However if your website is already getting a fair number of visitors and you know your code has errors you can look for clues as to which browsers struggle with your content.

  1. Open Google Analytics and select Audience > Technology > Browser & OS
  2. From the list of Browsers look for the ones where you had more than 30 visitors (enough data to know for sure if there is an issue). If the numbers are low you can change the date range in the top right of the screen to cover a longer time period and give you better data.
  3. Now check if any browsers have an unusually high bounce rate and low Avg. Session Duration compared to others. If they do there is a good chance that the errors reported by the validators are causing issues in those browsers and you'll need to get techie, or get techie help, to resolve those.

For every user who finds you in a search engine but then backs out because your content does not display correctly, the search engine takes note. In their eyes your obviously not answering the question very well so perhaps you shouldn't be ranking there ....

Code issues that aren't errors

Most websites are on platforms like WordPress which make it really easy for you to create content without flaffing around with code to make it look great. However when work is regularly edited invisible issues in code can start to gather.

Here's some code I recenly saw on a client's website:

<b><span style="font-weight: bold;">T</span><span style="font-weight: bold;">raffic</span></b>

Users will see the word Traffic just fine but search engines might not!.

Usually your platform will have a way for you to check this. In WordPress, open a post or page to edit and at the top right of the main text entry area you will see two tabs: Visual and Text.

Click on the Text version to see much of the underlying code and check for issues like the example above, especially where words are being physically broken apart.

If you are not on WordPress have a search or ask on a relevant forum to see if a similar option is available for your platform.

I'm Tim Hill, a Search Engine Optimization and Online Marketing specialist. I created this site to help others understand that SEO is not a mysterious black art!.

If your a newbie try the Getting Started in SEO page, otherwise feel free to dig around and learn more.

Find me on Facebook or get in touch if you need help.

Need Help? Seo Assistance
this man can affect your rankings