People who work in search engine optimisation sort its methods by hat colour. White hat means working within the rules the search engines publish. Black hat means breaking them to rank faster or higher. Grey hat covers whatever falls in between.

The labels are informal. No search engine uses them in its guidelines, and the boundaries shift as those guidelines change. This guide explains where the terms came from, what is usually put in each group, and what search engines do about it.

Where the terms came from

The image is from the cinema. In American Westerns, heroes were often given white hats and villains black ones, so that the audience could tell them apart at a glance.

The same pair of labels is used in computer security, where a black hat hacker breaks into systems with malicious intent, a white hat tests them with permission, and a grey hat sits between the two.

When the labels were first applied to SEO is not recorded in anything we could find. The best evidence we have read is an article by the SEO consultant Jill Whalen, published on 16 November 2004. She wrote that “for the past year or two” some people had been labelling different forms of SEO by hat colour: white for what was called ethical SEO, black for those others called spammers, and grey for those in between. That places the usage in about 2002 to 2003. We have not found a source that names who used the terms first, or that shows whether SEO took them from computer security or directly from the films.

Whalen’s article is also an early statement of a doubt that has followed the terms ever since. She put herself in the white hat group and then questioned whether the labels meant much. The two kinds of practitioner, she wrote, had different clients and different business models. Those using black hat methods generally expected their sites to be banned eventually and had planned for it.

What the labels are measured against

Hat colour is defined by the search engines’ rules, which in practice has usually meant Google’s.

Wikipedia’s summary puts it this way: white hat techniques are those that conform to the search engines’ guidelines, and black hat techniques are those the engines disapprove of or that involve deception.

Google’s own documents never mention hats. They talk about spam. Its spam policies list practices that can cause a page or a whole site to rank lower or to be left out of results altogether. That list is the nearest thing to an official definition of black hat SEO.

Because the standard is a published policy, it moves. A method can change colour without changing at all, when the policy is rewritten around it.

Tactics usually called black hat

Each of these appears in Google’s spam policies. The descriptions are ours.

  • Cloaking. Showing a search engine’s crawler one page and human visitors another.
  • Hidden text and links. Putting words or links on a page where crawlers will read them and people will not see them: white text on a white background is the policy’s own example.
  • Keyword stuffing. Repeating words or lists of terms until the text stops reading naturally. See our guide to keyword density.
  • Doorway pages. Sets of near-identical pages, each aimed at a slightly different search, that all lead to the same place. Our guide to landing pages explains how these differ from legitimate ones.
  • Sneaky redirects. Sending a visitor to a different page from the one the search engine was shown.
  • Link spam. Creating links mainly to influence rankings: buying or selling them, exchanging them to excess, or generating them with software. The policy notes that paid links are acceptable when they are marked with a nofollow or sponsored attribute so that they pass no ranking credit.
  • Scraped and mass-produced content. Copying other sites’ material, or generating large numbers of pages that add nothing for a reader. The policy says this applies however the pages are produced, and names generative AI tools among its examples.
  • Hacked content. Placing pages or links on someone else’s site without permission. This goes beyond breaking a search engine’s rules.
  • Expired domain abuse. Buying a lapsed domain in order to rank low-value content on its past reputation. Our article on Google’s updates covers when this was added to the policy, and why it matters to a site like this one.

Wikipedia’s article on spamdexing, an older word for the same thing, groups these into content spam and link spam and lists further variants, including link farms, private blog networks and comment spam.

Tactics usually called white hat

White hat SEO is harder to list, because it is mostly ordinary good practice in building a website.

Google’s SEO Starter Guide is the closest thing to a catalogue. It covers making sure pages can be crawled and indexed, organising a site sensibly, writing accurate titles and descriptions, and publishing content that is helpful and written for people. It also says plainly that it contains no secrets that will automatically put a site first.

In practice the white hat list looks like this:

  • Make pages reachable and readable by crawlers. Our guides to robots and indexing and JavaScript and search cover the mechanics.
  • Find out what words people search with, and use them where they belong.
  • Write pages that answer the question a searcher has.
  • Earn links by publishing something worth linking to, and by telling people it exists.
  • Keep the site fast and usable on a phone.

Wikipedia notes that white hat SEO has been compared to web development that promotes accessibility, though the two are not the same. Both amount to making a site’s real content easy to reach.

Grey hat

Grey hat is the least precise of the three. Whalen in 2004 used it for those who were neither spotless nor outright spammers. A Search Engine Journal article of 2020 defines it as tactics that are neither one nor the other.

No policy has a grey category. A practice either falls under a spam policy or does not, and where it falls is sometimes only clear once the search engine acts. Wikipedia’s summary adds the necessary warning: tactics described as grey may still result in a penalty.

The term is most often applied to methods that are tolerated at small scale and treated as spam at large scale. Exchanging a link with a business partner is unremarkable. Google’s policy objects to excessive link exchanges. Somewhere between the two is a line that is not published.

How search engines respond

By detecting it automatically. Most spam is dealt with by software. Google’s report on its spam fighting in 2021 describes an AI-based system called SpamBrain, launched in 2018, and claims that it keeps more than 99% of searches free of spam. That is Google’s figure about its own results and cannot be checked from outside.

By human review. Google’s help page on manual actions explains that a manual action is issued when a human reviewer decides that pages do not comply with the spam policies. The site is then ranked lower or omitted. The owner is told in Search Console, can fix the problem, and can ask for a review.

By removing the reward. Some responses make a tactic pointless without punishing anyone. In January 2005 Google announced the nofollow attribute: links carrying it would get no credit in ranking, which removed the reason to spam blog comments with links.

By changing the ranking systems. Our article on Google’s updates describes Penguin, announced in April 2012 as aimed at webspam, and the spam policies added in March 2024.

By making an example. In February 2006 Matt Cutts, then on Google’s webspam team, wrote that Google had removed BMW’s German site from its index. Search engines had been shown pages of text, and visitors’ browsers were then redirected by JavaScript to different ones. The BBC reported that BMW admitted using doorway pages and denied any attempt to mislead users. Wikipedia records that the company fixed the pages and was restored.

By using its own public scores. While the Google Toolbar still displayed PageRank, Google lowered the visible score of sites that sold links. Our history of toolbar PageRank covers that episode.

The trouble with the labels

The hats suggest a moral judgement, and the standard behind them is a commercial one.

That criticism is as old as the terms. Whalen’s 2004 article argued that the distinction was not really between good and bad people but between business models: one built for a stable site over years, the other for quick returns from domains that were expected to be thrown away. The 2020 Search Engine Journal article makes a similar case at more length, pointing out that the definitions derive from what Google permits and penalises, and so carry Google’s interests with them.

Two things follow that are worth holding on to.

First, “black hat” is not a synonym for “illegal”. Most of what the term covers breaks a search engine’s terms and nothing else. The consequence is losing rankings. A few tactics, such as planting content on someone else’s site without permission, may break the law as well.

Second, “white hat” is not a synonym for “effective” or “safe for ever”. It means only that a method is within today’s published rules.

A practical test

Google’s policies define spam largely by purpose: links created primarily to manipulate rankings, pages generated primarily to manipulate rankings, content placed solely for search engines.

That gives a workable question for any tactic: would you still do this if search engines did not exist? A page written to answer a customer’s question passes. A link from a supplier’s site that sends you customers passes. Three hundred pages that differ only in the name of a town do not.

The other question is Whalen’s. A method that works until it is detected suits a site that is meant to be disposable. For a business that intends to keep its domain, the risk is the whole site.