SpunkArt
Websites, APIs and search

Meta tags explained, with a head tag builder

Meta tags sit in the head of an HTML page and tell browsers, search engines and social apps about the page. Only a handful matter today; the rest is clutter.

The tags worth writing

TagWhat it does
<meta charset="utf-8">Tells the browser how to decode text. Put it first.
<meta name="viewport" ...>Makes the page scale properly on phones.
<title>The tab label and usually the clickable headline in search results.
<meta name="description">A summary that search engines may show under the title.
<link rel="canonical">Names the preferred address when the same content is reachable at several URLs.
<meta name="robots">Optional. Use noindex to keep a page out of search results.

The old keywords meta tag is ignored by major search engines. Leave it out.

Head tag builder

The builder only formats the text you type. It escapes characters such as quotes and ampersands so the snippet stays valid HTML. Copy the output into the head of your page.

How long should a title be?

Search results cut titles by pixel width, not a fixed number of characters, so wide letters such as W take more room than i. As a working rule, keep titles under about 60 characters and put the words that matter first. A title that gets cut is not penalised; it just loses its ending.

Writing a description people click

  • Say what the reader gets, in plain words.
  • Aim for roughly 120 to 160 characters so most of it survives on a phone screen.
  • Write a different one for every page. Search engines often rewrite descriptions that are duplicated or that do not match the query.

Weak: “Welcome to our website. We have lots of great information.”
Better: “Step-by-step guide to moving a cactus to a bigger pot: when to do it, what soil to use and how to handle spines safely.”

Canonical tags in practice

The same article might load at the bare domain, the www version, and with a tracking parameter on the end. A canonical tag on each copy pointing to one clean address tells search engines which one to show. Use the full address, including the scheme, and make sure that address returns a 200 status rather than a redirect.

Mistakes

  • Leaving a noindex from a staging site on the live site.
  • Pointing every page’s canonical at the home page.
  • Putting meta tags in the body, where they are ignored.

Questions

Does the description affect rankings?

Not directly. It affects how attractive the result looks, which influences whether people click.

Where do social preview tags fit?

Open Graph tags are a separate set used by social apps. The Open Graph page on this site covers them.