Everything I know about SEO as a developer

2021-02-07 / Niclas Timm

For developers and programmers SEO sometimes is a blackbox. This post provides an introduction to SEO for coders.

Developers often have touch points with SEO, especially the technical side of it. They also know that it is a really important marketing aspect, as most websites traffic comes from Google. However, programmers often hesitate to learn more about SEO because they see it as a blackbox. Nobody really knows what's working and what's not 🤷‍♂️. But no matter for which purpose - a job, personal project etc. - SEO knowledge is key. For my feedback app, for example, I'll have to rely heavily on SEO in order to get free traffic. This post provides an introduction to SEO for developers.

Understand the goal of a search engine

If we understand the goal of a search engine we can better understand the actions it takes. The goal of a search engine like Google is to ensure that the user will keeps getting back in the future. Only then it can sell more ads and collect more data. How can it achieve this? Simply by providing the user with the best answer to her question. Or would you keep using Google when you were given links to cheesecake recipes when searching for "Golden Retriever puppies"?

SEO is data driven: Start tracking

Now that we know what search engines want to achieve let's get one thing straight: Only data driven SEO is good SEO. If you want your website to rank well sustainably, you cannot throw stuff against the wall and hope it sticks. You'll have to find out why some stuffs sticks and other stuff doesn't. This means analysing your data from all different angles to find out who your users are, what pulls them in and pushes them away. Only then you can optimise your content accordingly and maximise traffic and conversion.

Google Analytics

Chances are you already have Google Analytics hooked up to your website as it's a very public tool. If not, do it right now! Google Analytics is a free tool that allows you to collect all sorts of data about your users. If you want to become an expert I recommend the free certificates offered by Google. But beware data privacy problems with Google Analytics, especially in Europe! But that's a completely different topic...

Google search console

Another tool provided by Google. It provides you with more information about how your website is actually presented in the Search Engine Results Page (SERP). For example, it tells you how often a user saw a link to your website ("impression") and how often it was clicked. If you want to connect your website to the search console you might find this tutorial by semrush helpful.

Google Data Studio

This is no absolute must but a nice-to-have. The Google Data Studio allows you to easily aggregate data from multiple resources and create beautiful dashboards. For example, with just a few clicks you can connect to Google Analytics and the Google Search Console and create statistics and insights you wouldn't be able to create with only one data source. Plus, there are a bunch of community templates that you can reuse so you don't have to do all the work yourself.

Meta Tags: The foundation

Meta tags are really valuable for the search engine because they help it to approximate the topic and summary of your content. Also, some of these tags are displayed in the SERP where visitors will see them. Thus, you can think of the meta tags as your digital elevator pitch 😉. Let's take a look at the most important ones.

Title

Always set the title tag. It's the large heading that is displayed for every result on the results page. Programmatically, you set the title tag like this:

<head>
  <title>Your awesome title</title>
</head>

When setting the title for a page, always ask yourself these questions:

  • Is my main keyword in the title?
  • Does it grab the user's attention?
  • Is it clickworthy but not clickbaity?

If you can answer all theses questions with "yes" you are on the right track.

Description

The description will also be displayed in the search results. It's the snippet that comes right beneath the title. You set it like this:

<head>
  <meta name="description" content="Your meta description" />
</head>

It is another possibility to describe to visitors what your content is about, what they will get from it and why they should click on it. Google only displays the first 160 of it, so try to limit the length accordingly. But also don't keep it too short. Otherwise you miss the opportunity for the search engine and the user to grasp what your content is about.

Open Graph

Ever wondered why the teasers always look so perfect when you share a link on social media or on Slack? Chances are that's due to the Open Graph meta tags. With the Open Graph tags, you can decide what the headline, image and other information will be when you share it anywhere. there are a couple of OG tags you can create, which you can find here. For example, you can set the Open Graph title like so:

<head>
  <meta name="og:title" content="Your title" />
</head>

If you want to check out how your social media snippet looks like on the different platforms you can use Social Share Preview.

Create a Sitemap.xml

Since you are a developer you probably already know what the sitemap.xml file is. If not it's time to find out!

In short terms, the sitemap.xml file is a list of the URLs on your website. For Google, this acts as a roadmap to tell which content is available and where. Sitemaps are especially valuable on websites with:

  • Large amounts of pages
  • Large crawl depth / deep architecture
  • Weak internal linking

The best way to tell Google about your Sitemap is to submit it via the Google Search console. This also increases the speed of indexation for your websitel

Include a Robots.txt to prevent certain content from being indexed

In some cases you might not want the search engine to index a page. For example, you might not want your legal page or data privacy page to be ranked on Google. In that case you would create a Robots.txt file and include the respective paths like so:

#Code to not allow indexing the legal and privacy page! User-agent: * Disallow:
/legal Disallow: /privacy

Keywords

You probably heard the term "keyword" before. In the SEO world, keywords are what users type into the search engine in order to find the right information. The search engine then queries its database and finds the content that fits that exact keywords best. Googles search algorithm is proprietary and one of best kept secrets in the world (except from the Coca Cola formula, probably). But it is obvious that the words you use in your content determine the keywords your page will rank for. For example, if you repeatedly use the word "ice cream" in your content, chances are your rank for the keyword "ice cream" instead of "chocolate chip cookies".

Short-Tail vs. Short-Tail keywords

There are two types of keywords: Short-tail keywords, which consist of only one word, and long-tail keywords, which consist of at least two words. There is a lot debate about which you should optimise your content for, but honestly, neither is better. If you optimise for short-tail keywords like "programming" you're likely to get more exposure int the SERP (called "impressions") but lower conversion rates compared to when optimising for long-tail keywords. The reason is simple: the more specific a query is, the better Google can provide the right content. So if you rank for "programming in Javascript for beginners", the user is more likely to click on your content as you provide the answer their specific question. However, if you rank for "programming" and your content is about Javascript, the user is less likely to click, since she might have looked for PHP content but only searched "programming".

Avoid keyword cannibalism

Make sure that each piece of content ranks for different keywords. If you have, for example, two posts that rank for the keyword "programming in Javascript for beginners", these pieces compete with each other. This is suboptimal since they serve the same purpose: bringing more traffic to your website. This is called "keyword cannibalism". You can prevent this by defining the keywords you want to rank for BEFORE you start writing and making sure no other content competes for the same keywords. If both posts are already published, however, this isn't the end of world. You can solve this this with canonical URLs, which we will discuss later.

Free keyword research tools

There are a lot of tools to help you find the right keywords. Many of them are paid, but for indie hackers this might not be feasible. Luckily, there are a couple of free ones you can levarage:

Backlinks - the holy grail of SEO

Backlinks are links from other websites that point to your website. They have been one of the major determinants for rankings since the early days of Google. And that's for a good reason. If many people reference your content that's a strong indicator that your content is of high quality. Thus, building backlinks is really important if you take SEO seriously. But unfortunately, they're also one of the toughest parts. Convincing others to link to your content is hard. And Google has become really good at detecting Black Hat methods like "dummy websites" that contain nothing but links to other websites.

Use canonical URLs for duplicate content and keyword cannibalism

Duplicate content is a big problem in SEO, since it makes it hard for Google to determine which version of the content should rank and which should not. Of course you should generally avoid having duplicate content on your websites, but sometimes that's not possible. You might, for example, have the same content under blogand blog/latestor under tags/covidand tags/covid19. You can solve this problem by including a canonical meta tag on page 1 and reference page 2 there. This tells Google to transfer the link juice from page 1 to page 2 and only rank page 2.

You can include a canonical tag like this:

<head>
  <link rel="canonical" href="https://www.website.com/page/" />
</head>

You can also use canonical tags to avoid the problem of keyword cannibalism. Just include a canonical tag on the page that ranks worse than the other.

Make URLs readable

You should make your URL structure as clear and readable as possible. This makes it easier for both search console and humans to determine the topic of your content. In order to do so, keep your URLs as short as possible and use hyphens ('-') to separate words. Most CMSs like WordPress or Drupal provide that functionality out of the box.

Manage your links

Links are an essential part of your websites. They help the search engine to crawl your website and help the user discover further content.

Internal links

Each piece of your content should have internal links. That means links that bring the user (or crawler) to another page of your website. This increases the value for the user and helps the crawler reach all your pages. Plus, it establishes an information hierarchy.

Watch out for orphans

There should be no pages on your website that don't receive internal links. Otherwise it will be hard for the search engine to index all your pages. You loose valuable ranking opportunities due to that.

Fix broken links

Search engines don't like 404s. So avoid sending them to content that does not exist. This applies to internal as well as external links. Especially the latter is hard to monitor as you can't control if someone else deletes their content. However, you can include a broken link check in SEO audits, which we'll discuss later.

Efficient redirect management

Since you are a developer I probably don't have to tell you what redirects are and what their status codes mean. But just as a reminder: status codes with 3XX mean that the content is not reachable under the given link. Search engines know that.

Google stores the content of a URL and computes the ranking based upon that. When the search engine comes back later to crawl again and finds different or no content, this negatively affects rankings. Using a redirect you can tell Google that the content was not deleted but moved and so the rankings will be transferred to the new URL.

Frequently audit your website

As your website and its content changes over time it might be appropriate to audit it for any SEO issues like broken links, keyword cannibalism or duplicate content. From a technical SEO perspective, you can use a free tool like Google lighthouse to find SEO issues.

To get an overview of which pages of your website rank, you can enter "site:your-domainname.com" into Google and see the results. If the number of results diverges massively from your expectations this is an indicator for an error.

In these audits you should also try to figure out which content on your website does not fit the strategy of your website anymore or does not rank on Google. Delete them.

Shape the product & get updates

Tired of only reading about the progress? Subscribe to the mailing list & get early access to the feedback app, become a beta tester and experience how the app eveloves due to your valuable input. Plus, you'll be the first to receive updates!