Skip to content

Instantly share code, notes, and snippets.

@AndreiHondrari
Last active September 3, 2018 18:45
Show Gist options
  • Save AndreiHondrari/6d6ead6b7836f82225ee0e970638bddd to your computer and use it in GitHub Desktop.
Save AndreiHondrari/6d6ead6b7836f82225ee0e970638bddd to your computer and use it in GitHub Desktop.

Important HTML Meta tags for basic SEO

HTML tag attributes

<html lang="<< here goes language code >>" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# product: http://ogp.me/ns/product# article: http://ogp.me/ns/article#">

Generic meta tags

<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="title" content="<< here goes meta title >>"/>
<meta name="description" content="<< here goes meta description >>"/>
<meta name="viewport" content="width=device-width, initial-scale=1">

Google Site

<meta name="google-site-verification" content="<< Google Site Verification ID goes here >>" />

Open Graph meta tags -> needed for facebook

<!-- Open Graph meta tags -->
<meta property="og:title" content="<< here goes page title again like in meta-title >>" />
<meta property="og:type" content="website << or something else -> check OG reference >>" />
<meta property="og:url" content="<< here goes current full URL with domain and protocol >>" />

<meta property="og:image" content="<< full image URL representing the page >>" />
<meta property="og:image:url" content="<< full image URL representing the page >>" />
<meta property="og:image:secure_url" content="<< full image URL representing the page >>" />

<meta property="og:description" content="<< here goes meta OG description >>" />
<meta property="og:locale" content="<< here goes language code >>" />

<meta property="og:locale:alternate" content="<< some other language code >>" />
<meta property="og:locale:alternate" content="<< some other language code >>" />
<meta property="og:locale:alternate" content="<< some other language code >>" />
... and others

<meta property="og:site_name" content="<< here goes the site name >>" />

<!-- Facebook meta tags - still part of the OG -->
<meta property="fb:app_id" content="<< here goes the facebook App ID >>" />

Twitter specific tags

<!-- Twitter Card meta tags -->
<meta name="twitter:card" content="summary << or some other Twitter type of card >>"/>
<meta name="twitter:site" content="@<< here goes twitter site ID >>"/>
<meta name="twitter:title" content="<< here goes the page title, same like OG title and main meta title >>"/>
<meta name="twitter:description" content="<< here goes the page description again >>"/>
<meta name="twitter:image" content="<< twitter image full URL representing the page goes here >>"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment