Metatag

A metatag, more often written as meta tag, is an element in the head of a web page that describes the page without appearing on it. Browsers, search engines, and social networks read these tags to decide how to handle and show the page.

Four common metatags and what each does

The description tag gives a short summary, which can become the snippet under a search result. The viewport tag tells phones to fit the page to the width of the screen, and every responsive site needs one.

The robots tag gives search engines instructions. Adding noindex to it keeps a page out of their results. A tag named googlebot does the same job for Google's crawler alone. The keywords tag was once used to list a page's keywords, but Google has ignored it for years, so it's safe to leave it out.

There are plenty of others. The theme-color tag, for example, sets the colour of the browser bar on some phones.

How meta tags are written

Each meta tag has a name or a property that says what kind it is, and a content value. They all sit inside the page's head, and a page can have as many as it needs.

Open Graph tags start with og:. They set the title, description, and image that appear when someone shares a link on social media. The charset tag tells the browser which character set the text uses, so letters and symbols display properly.

The metatags at the top of our own pages

Our live website and the new one we're building both start every page with a handful of meta tags.

  1. bird.co.uk/contact/
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5" />…<meta name='robots' content='index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1' />
    Viewport and robots on our live site

    Our live contact page tells phones to fit it to the screen, while still letting people zoom in. Its robots tag allows indexing and the following of links. It also lets Google show a large image preview and a snippet of any length.

  2. Our new site's layout
    <meta charset="utf-8" /><meta name="viewport" content="width=device-width,initial-scale=1" /><title>{meta.title}</title><meta name="description" content={meta.description} />…<meta property="og:description" content={meta.description} />
    Written once for every page

    On our new site, these tags are written once, in the layout that every page shares. Each page passes in its own title and description. The same description also fills the og:description tag, which is used when the page is shared.

Metatag mistakes worth checking for

A noindex tag left on a live site after launch is one of the most common. It quietly keeps pages out of Google until someone spots it. Two robots tags that contradict each other cause trouble too, as does a viewport tag that stops people zooming in. Checking the head of your main page templates after each release catches most of these problems.

More technical SEO glossary terms

These technical SEO glossary terms cover crawling, indexing, redirects, sitemaps, structured data and page speed. Each definition shows the idea in a diagram and gives a practical example, so developers, marketers and site owners can talk about the same fix in the same words.