Skip to content
Tutorials Center
My learning

Topics

Lesson 3 of 36 ยท Getting Started

White Hat, Black Hat and Search Engine Guidelines

Learn the difference between white hat, grey hat and black hat SEO, which tactics break search engine guidelines, and how penalties and recovery work.

Search engines publish rules about what they consider acceptable. Tactics that follow the rules and help users are called white hat. Tactics that try to trick the ranking system are called black hat. In between sits a fuzzy area people call grey hat. This lesson explains the categories, shows the most common violations, and gives you a way to judge a tactic before you use it.

The most important point is practical: shortcuts can work for a while, and then a site loses its traffic overnight. Recovery can take months. Understanding the line protects your project and your clients.

The hats

  • White hat: useful content, clear structure, honest titles, fast pages, links earned because people value your work. It is slower but durable.
  • Grey hat: techniques that are not clearly forbidden but exist mainly to influence rankings, such as buying "sponsored" placements without disclosure markup, or mass-producing thin pages with light editing. Risk rises as the scale rises.
  • Black hat: deliberate deception of users or search engines.

The names come from old Western films and are only a metaphor. What matters is intent and effect: does this help the person who searches, or does it only manipulate a ranking system?

A simple test

Before using a tactic, ask four questions:

  1. Would I do this if search engines did not exist?
  2. Would I be comfortable explaining it to the person who sees the page?
  3. Does a visitor get the same content a crawler gets?
  4. If every competitor did it, would the web be worse?

If the honest answers are "no", "no", "no" or "yes, worse", walk away.

Common violations

Search engines name a number of spam techniques in their guidelines. The names below are generic; exact wording differs between engines.

Tactic What it is Why it is a problem
Keyword stuffing Repeating a phrase unnaturally or listing keywords in a block Makes pages unreadable; ranking systems detect it
Hidden text White text on white background, text off-screen, tiny font Content users cannot see but crawlers can
Cloaking Showing crawlers a different page from users Deceives both users and engines
Sneaky redirects Sending users somewhere other than what the result promised Bait and switch
Doorway pages Many near-identical pages targeting slight keyword variations Adds clutter, no value
Scraped or spun content Copying other sites or auto-rewriting them No original value
Link schemes Buying links that pass ranking credit, link farms, link exchanges at scale Manipulates link-based signals
Comment and forum spam Dropping links in unrelated places Pollutes other sites
Mass automated content Generating many pages mainly to rank, without helping anyone Low value at scale
Malware or deceptive downloads Harming users Always removed

Never test black hat tactics on a site you care about. Even "just one page" can attract a manual review of the whole site.

Try it: a keyword stuffing detector

One signal of stuffing is how large a share of the page one phrase takes. The program below counts the most frequent words after removing common function words. It is a teaching heuristic, not how a real search engine decides, and no single number proves spam; use it to notice text that reads oddly.

Python Keyword stuffing detector

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The stuffed sample is dominated by three words, while the natural one has no word above a small share. Readers notice this immediately, which is the real reason to avoid it: pages written for engines first rarely convert.

Links between sites are a large topic (see the later chapters on link building), but you should know the vocabulary now. Search engines ask you to mark links that exist because of money or user-generated content:

HTML
<a href="https://partner.example/" rel="sponsored">Our partner</a>
<a href="https://forum.example/post" rel="ugc">User-submitted link</a>
<a href="https://example.org/" rel="nofollow">Link we do not vouch for</a>

sponsored marks paid or affiliate links, ugc marks links inside user-generated content such as comments, and nofollow is the general "do not treat this as my endorsement" hint. Marking links honestly is white hat; hiding paid links is a violation.

Penalties and recovery

There are two ways a site can lose visibility for spam:

  • Algorithmic demotion. Automated systems lower the ranking of pages or whole sites that match spam or low-value patterns. There is usually no message; you only see traffic fall.
  • Manual action. A human reviewer applies a penalty. Search engines normally tell you inside their webmaster tools (see your SEO toolkit), describe the problem category, and let you request a review after you fix it.

A recovery plan looks like this:

flowchart TD
    A["Traffic drops"] --> B{"Manual action message?"}
    B -->|Yes| C["Read the category and examples"]
    B -->|No| D["Check timing against known updates and site changes"]
    C --> E["Fix the problem everywhere"]
    D --> E
    E --> F["Document what you changed"]
    F --> G["Request a review (manual action only)"]
    G --> H["Wait, monitor, keep improving"]

Fix the cause on the whole site, not only the example URLs. Recovery is not instant.

Not every drop is a penalty. Seasonal demand, a site migration, a broken robots.txt file or a competitor's new page can all explain a decline. Diagnose before you act.

Try it: a tactic risk checklist

This small program scores tactics against the four questions from earlier. The weights are arbitrary teaching values; the purpose is to practice judging tactics with a consistent checklist instead of gut feeling.

Python Tactic risk checklist

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is cloaking?

    Cloaking deceives both users and search engines by serving different content to each.
  2. 2. Which rel value should mark an affiliate or paid link?

    rel=sponsored tells search engines that the link exists because of payment or an affiliate arrangement.
  3. 3. A site's traffic falls sharply and no manual action message appears. What is the best first step?

    Many drops have non-penalty causes. Diagnose first, then fix the real problem.
  4. 4. Why is keyword stuffing a bad idea even if a detector missed it?

    Unnatural repetition drives readers away, which defeats the purpose of ranking.

Summary

  • White hat helps users and follows search guidelines; black hat deceives; grey hat is risky and scale-sensitive.
  • Typical violations: keyword stuffing, hidden text, cloaking, doorway pages, scraped content, link schemes.
  • Mark paid links with rel="sponsored" and user-generated ones with rel="ugc".
  • Penalties can be algorithmic or manual; diagnose first, fix everywhere and document the changes.

Next: The SEO Process and Your Toolkit