Skip to content

Cyber Sale: Save big on Moz Pro! Sign up by Dec. 6, 2024

Search engines 5511dd3

Applying On-Site SEO to Website Templates (Or Why Separation of Code and Content is a Good Thing)

D

The author's views are entirely their own (excluding the unlikely event of hypnosis) and may not always reflect the views of Moz.

Table of Contents

D

Applying On-Site SEO to Website Templates (Or Why Separation of Code and Content is a Good Thing)

The author's views are entirely their own (excluding the unlikely event of hypnosis) and may not always reflect the views of Moz.

There are lots of people who would class themselves as a developer and would say they can code in any given language. Often the difference between a good developer and a great developer isn't anything to do with the program, how well it works, and how few bugs there are. The great developers make programs that work but they make them in a way that isolates the various components from each other.

I want to run through a few examples and apply these very same thought processes to SEO. There are a number of places where it would be beneficial to separate the various logical components of, for example, a web site.

Many of you will have heard of the acronym MVC (Model - View - Controller), which is one example of a software pattern designed to separate the various components of a website. In this case the pattern is designed to separate the information storage (the model) from the user interface (the view). The controller manages the communication between the view and the model.

In a large development team you often find experts in each stages of the development, so you have someone who understands the model (which normally maps to a database) and all the business rules. At the front end (the view) you have experts in HTML and CSS. I've never quite been able to separate the role of the controller from the model, so I'll skim over that and hope you don't notice.

No matter what software pattern is used to code your webpage, it is (and has been for a long while) good practice to separate the structure of a site from the presentation of the site. The HTML should contain no information about how to display the page. This should purely be the structure and semantic information required for the page. This is one of the major failings of websites that use tables for layout purposes, which in almost all situations has to place a lot of the presentational information within the HTML.

The final level of separation that most websites employ is to separate the content from the structure of the site. This is normally done by placing the content in a database and embedding this in the HTML when the page is requested.

In fact, we (and many others) take this one step further and store this content in a text based format with (the majority) of HTML stripped out, and replaced with a markup language called markdown. This means our clients don't have to learn HTML in order to update their website, but by following a few simple rules we can still have semantically marked up code.

The theory is all well and good, but how does this help you as an SEO? Just like a development team, the main benefit is that you can have different people working on different areas of the site.

1. Technical site review changes

The vast majority, if not all changes we request early on in a project are found in a technical site review, which should be implemented by the team working on the backend (or often the template of a site). This can normally be looked at completely separately from any content changes, and can be implemented as such.

Those of you without a templating system will almost certainly know the heartache involved with having to update every page of a site to make a simple change. That was the way most sites were written 6,7 or 8 years ago, and is why most of those sites were rarely updated.

2. Content creation

In most large organisations its hard enough asking people creating content to think in terms of keywords. The last thing you want is for them to also be the ones creating the HTML. By separating the content from the template, you can ensure that the content created by people with no understanding of HTML or semantic markup is still optimised.

3. Site re-designs

I'm certainly guilty of getting bored with websites quickly, and we have seen two major versions of the Distilled site within the last two years, and there have been many more tweaks in the intervening times. All of this would have been much much harder (to the point of not worth doing) if our content wasn't stored without any information about how it will be displayed in our content management system.

On a side note, one of my pet peeves is when I am digging around the source code and (I kid you not) you see something like the following:

<div class="blue-arial-14pt-bold">Text</div>

Creating class names like that does not count. Imagine your designer comes along and wants to change the style of the above elements to green text in 12pt verdana. You now have text labeled "blue arial 14pt," which is green and verdana. The guy who takes over updating the CSS is going to LOVE you for that.

Consistency

One of the issues with sites that have a large number of pages is that without a tool sat helping you it is impossible to look at the code of every page. With the confidence that comes with knowing the site was written using templates or a pattern that includes views, you can be confident that if a given page uses the H1 tag in the correct way then the other pages of a similar type will also.

I guess the point I'm trying to make is that having good developers who understand not only how to write good websites (or tools, or programs, etc), but how to write them *well* will make a huge difference. This isn't immediately obviously an SEO benefit, but anything that can make development or creating content will in the long run make your SEO efforts more effective.

Back to Top

With Moz Pro, you have the tools you need to get SEO right — all in one place.

Read Next

The Mozbot Mashup: Roger Explores the World of Generative AI Imagery

The Mozbot Mashup: Roger Explores the World of Generative AI Imagery

Mar 07, 2023
One Secret to Improve SEO in 2021: Guestographics

One Secret to Improve SEO in 2021: Guestographics

Jul 21, 2021
Pop-Ups, Overlays, Modals, Interstitials, and How They Interact with SEO

Pop-Ups, Overlays, Modals, Interstitials, and How They Interact with SEO

Apr 28, 2017

Comments

Please keep your comments TAGFEE by following the community etiquette

Comments are closed. Got a burning question? Head to our Q&A section to start a new conversation.