Coder Social home page Coder Social logo

head's Introduction

🤯 HEAD

A simple guide to HTML <head> elements

Contributors CC0 Follow @joshbuchea on Mastodon

Table of Contents

Recommended Minimum

Below are the essential elements for any web document (websites/apps):

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--
  The above 2 meta tags *must* come first in the <head>
  to consistently ensure proper document rendering.
  Any other head element should come *after* these tags.
 -->
<title>Page Title</title>

meta charset - defines the encoding of the website, utf-8 is the standard

meta name="viewport" - viewport settings related to mobile responsiveness

width=device-width - use the physical width of the device (great for mobile!)

initial-scale=1 - the initial zoom, 1 means no zoom

⬆ back to top

Elements

Valid <head> elements include meta, link, title, style, script, noscript, and base.

These elements provide information for how a document should be perceived, and rendered, by web technologies. e.g. browsers, search engines, bots, etc.

<!--
  Set the character encoding for this document, so that
  all characters within the UTF-8 space (such as emoji)
  are rendered correctly.
-->
<meta charset="utf-8">

<!-- Set the document's title -->
<title>Page Title</title>

<!-- Set the base URL for all relative URLs within the document -->
<base href="https://example.com/page.html">

<!-- Link to an external CSS file -->
<link rel="stylesheet" href="styles.css">

<!-- Used for adding in-document CSS -->
<style>
  /* ... */
</style>

<!-- JavaScript & No-JavaScript tags -->
<script src="script.js"></script>
<script>
  // function(s) go here
</script>
<noscript>
  <!-- No JS alternative -->
</noscript>

⬆ back to top

Meta

<!--
  The following 2 meta tags *must* come first in the <head>
  to consistently ensure proper document rendering.
  Any other head element should come *after* these tags.
-->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<!--
  Allows control over where resources are loaded from.
  Place as early in the <head> as possible, as the tag  
  only applies to resources that are declared after it.
-->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'">

<!-- Name of web application (only should be used if the website is used as an app) -->
<meta name="application-name" content="Application Name">

<!-- Theme Color for Chrome, Firefox OS and Opera -->
<meta name="theme-color" content="#4285f4">

<!-- Short description of the document (limit to 150 characters) -->
<!-- This content *may* be used as a part of search engine results. -->
<meta name="description" content="A description of the page">

<!-- Control the behavior of search engine crawling and indexing -->
<meta name="robots" content="index,follow"><!-- All Search Engines -->
<meta name="googlebot" content="index,follow"><!-- Google Specific -->

<!-- Tells Google not to show the sitelinks search box -->
<meta name="google" content="nositelinkssearchbox">

<!-- Tells Google not to provide a translation for this document -->
<meta name="google" content="notranslate">

<!-- Verify website ownership -->
<meta name="google-site-verification" content="verification_token"><!-- Google Search Console -->
<meta name="yandex-verification" content="verification_token"><!-- Yandex Webmasters -->
<meta name="msvalidate.01" content="verification_token"><!-- Bing Webmaster Center -->
<meta name="alexaVerifyID" content="verification_token"><!-- Alexa Console -->
<meta name="p:domain_verify" content="code_from_pinterest"><!-- Pinterest Console-->
<meta name="norton-safeweb-site-verification" content="norton_code"><!-- Norton Safe Web -->

<!-- Identify the software used to build the document (i.e. - WordPress, Dreamweaver) -->
<meta name="generator" content="program">

<!-- Short description of your document's subject -->
<meta name="subject" content="your document's subject">

<!-- Gives a general age rating based on the document's content -->
<meta name="rating" content="General">

<!-- Allows control over how referrer information is passed -->
<meta name="referrer" content="no-referrer">

<!-- Disable automatic detection and formatting of possible phone numbers -->
<meta name="format-detection" content="telephone=no">

<!-- Completely opt out of DNS prefetching by setting to "off" -->
<meta http-equiv="x-dns-prefetch-control" content="off">

<!-- Specifies the document to appear in a specific frame -->
<meta http-equiv="Window-Target" content="_value">

<!-- Geo tags -->
<meta name="ICBM" content="latitude, longitude">
<meta name="geo.position" content="latitude;longitude">
<meta name="geo.region" content="country[-state]"><!-- Country code (ISO 3166-1): mandatory, state code (ISO 3166-2): optional; eg. content="US" / content="US-NY" -->
<meta name="geo.placename" content="city/town"><!-- eg. content="New York City" -->

<!-- Web Monetization https://webmonetization.org/docs/getting-started -->
<meta name="monetization" content="$paymentpointer.example">

⬆ back to top

Link

<!-- Points to an external stylesheet -->
<link rel="stylesheet" href="https://example.com/styles.css">

<!-- Helps prevent duplicate content issues -->
<link rel="canonical" href="https://example.com/article/?page=2">

<!-- Links to an AMP HTML version of the current document -->
<link rel="amphtml" href="https://example.com/path/to/amp-version.html">

<!-- Links to a JSON file that specifies "installation" credentials for the web applications -->
<link rel="manifest" href="manifest.json">

<!-- Links to information about the author(s) of the document -->
<link rel="author" href="humans.txt">

<!-- Refers to a copyright statement that applies to the link's context -->
<link rel="license" href="copyright.html">

<!-- Gives a reference to a location in your document that may be in another language -->
<link rel="alternate" href="https://es.example.com/" hreflang="es">

<!-- Provides information about an author or another person -->
<link rel="me" href="https://google.com/profiles/thenextweb" type="text/html">
<link rel="me" href="mailto:[email protected]">
<link rel="me" href="sms:+15035550125">

<!-- Links to a document that describes a collection of records, documents, or other materials of historical interest -->
<link rel="archives" href="https://example.com/archives/">

<!-- Links to top level resource in an hierarchical structure -->
<link rel="index" href="https://example.com/article/">

<!-- Provides a self reference - useful when the document has multiple possible references -->
<link rel="self" type="application/atom+xml" href="https://example.com/atom.xml">

<!-- The first, last, previous, and next documents in a series of documents, respectively -->
<link rel="first" href="https://example.com/article/">
<link rel="last" href="https://example.com/article/?page=42">
<link rel="prev" href="https://example.com/article/?page=1">
<link rel="next" href="https://example.com/article/?page=3">

<!-- Used when a 3rd party service is utilized to maintain a blog -->
<link rel="EditURI" href="https://example.com/xmlrpc.php?rsd" type="application/rsd+xml" title="RSD">

<!-- Forms an automated comment when another WordPress blog links to your WordPress blog or post -->
<link rel="pingback" href="https://example.com/xmlrpc.php">

<!-- Notifies a URL when you link to it on your document -->
<link rel="webmention" href="https://example.com/webmention">

<!-- Enables posting to your own domain using a Micropub client -->
<link rel="micropub" href="https://example.com/micropub">

<!-- Open Search -->
<link rel="search" href="/open-search.xml" type="application/opensearchdescription+xml" title="Search Title">

<!-- Feeds -->
<link rel="alternate" href="https://feeds.feedburner.com/example" type="application/rss+xml" title="RSS">
<link rel="alternate" href="https://example.com/feed.atom" type="application/atom+xml" title="Atom 0.3">

<!-- Prefetching, preloading, prebrowsing -->
<!-- More info: https://css-tricks.com/prefetching-preloading-prebrowsing/ -->
<link rel="dns-prefetch" href="//example.com/">
<link rel="preconnect" href="https://www.example.com/">
<link rel="prefetch" href="https://www.example.com/">
<link rel="prerender" href="https://example.com/">
<link rel="preload" href="image.png" as="image">

⬆ back to top

Icons

<!-- For IE 10 and below -->
<!-- Place favicon.ico in the root directory - no tag necessary -->

<!-- Icon in the highest resolution we need it for -->
<link rel="icon" sizes="192x192" href="/path/to/icon.png">

<!-- Apple Touch Icon (reuse 192px icon.png) -->
<link rel="apple-touch-icon" href="/path/to/apple-touch-icon.png">

<!-- Safari Pinned Tab Icon -->
<link rel="mask-icon" href="/path/to/icon.svg" color="blue">

⬆ back to top

Social

Facebook Open Graph

Most content is shared to Facebook as a URL, so it's important that you mark up your website with Open Graph tags to take control over how your content appears on Facebook. More about Facebook Open Graph Markup

<meta property="fb:app_id" content="123456789">
<meta property="og:url" content="https://example.com/page.html">
<meta property="og:type" content="website">
<meta property="og:title" content="Content Title">
<meta property="og:image" content="https://example.com/image.jpg">
<meta property="og:image:alt" content="A description of what is in the image (not a caption)">
<meta property="og:description" content="Description Here">
<meta property="og:site_name" content="Site Name">
<meta property="og:locale" content="en_US">
<meta property="article:author" content="">

Twitter Card

With Twitter Cards, you can attach rich photos, videos and media experiences to Tweets, helping to drive traffic to your website. More about Twitter Cards

<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@site_account">
<meta name="twitter:creator" content="@individual_account">
<meta name="twitter:url" content="https://example.com/page.html">
<meta name="twitter:title" content="Content Title">
<meta name="twitter:description" content="Content description less than 200 characters">
<meta name="twitter:image" content="https://example.com/image.jpg">
<meta name="twitter:image:alt" content="A text description of the image conveying the essential nature of an image to users who are visually impaired. Maximum 420 characters.">

Twitter Privacy

If you embed tweets in your website, Twitter can use information from your site to tailor content and suggestions to Twitter users. More about Twitter privacy options.

<!-- disallow Twitter from using your site's info for personalization purposes -->
<meta name="twitter:dnt" content="on">

Schema.org

<html lang="" itemscope itemtype="https://schema.org/Article">
    <head>
      <link rel="author" href="">
      <link rel="publisher" href="">
      <meta itemprop="name" content="Content Title">
      <meta itemprop="description" content="Content description less than 200 characters">
      <meta itemprop="image" content="https://example.com/image.jpg">

Note: These meta tags require the itemscope and itemtype attributes to be added to the <html> tag.

Pinterest

Pinterest lets you prevent people from saving things from your website, according to their help center. The description is optional.

<meta name="pinterest" content="nopin" description="Sorry, you can't save from my website!">

Facebook Instant Articles

<meta charset="utf-8">
<meta property="op:markup_version" content="v1.0">

<!-- The URL of the web version of your article -->
<link rel="canonical" href="https://example.com/article.html">

<!-- The style to be used for this article -->
<meta property="fb:article_style" content="myarticlestyle">

OEmbed

<link rel="alternate" type="application/json+oembed"
  href="https://example.com/services/oembed?url=http%3A%2F%2Fexample.com%2Ffoo%2F&amp;format=json"
  title="oEmbed Profile: JSON">
<link rel="alternate" type="text/xml+oembed"
  href="https://example.com/services/oembed?url=http%3A%2F%2Fexample.com%2Ffoo%2F&amp;format=xml"
  title="oEmbed Profile: XML">

QQ/Wechat

Users share web pages to qq wechat will have a formatted message

<meta itemprop="name" content="share title">
<meta itemprop="image" content="http://imgcache.qq.com/qqshow/ac/v4/global/logo.png">
<meta name="description" itemprop="description" content="share content">

⬆ back to top

Browsers / Platforms

Apple iOS

<!-- Smart App Banner -->
<meta name="apple-itunes-app" content="app-id=APP_ID,affiliate-data=AFFILIATE_ID,app-argument=SOME_TEXT">

<!-- Disable automatic detection and formatting of possible phone numbers -->
<meta name="format-detection" content="telephone=no">

<!-- Launch Icon (180x180px or larger) -->
<link rel="apple-touch-icon" href="/path/to/apple-touch-icon.png">

<!-- Launch Screen Image -->
<link rel="apple-touch-startup-image" href="/path/to/launch.png">

<!-- Launch Icon Title -->
<meta name="apple-mobile-web-app-title" content="App Title">

<!-- Enable standalone (full-screen) mode -->
<meta name="apple-mobile-web-app-capable" content="yes">

<!-- Status bar appearance (has no effect unless standalone mode is enabled) -->
<meta name="apple-mobile-web-app-status-bar-style" content="black">

<!-- iOS app deep linking -->
<meta name="apple-itunes-app" content="app-id=APP-ID, app-argument=http/url-sample.com">
<link rel="alternate" href="ios-app://APP-ID/http/url-sample.com">

Google Android

<meta name="theme-color" content="#E64545">

<!-- Add to home screen -->
<meta name="mobile-web-app-capable" content="yes">
<!-- More info: https://developer.chrome.com/multidevice/android/installtohomescreen -->

<!-- Android app deep linking -->
<meta name="google-play-app" content="app-id=package-name">
<link rel="alternate" href="android-app://package-name/http/url-sample.com">

Google Chrome

<link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/APP_ID">

<!-- Disable translation prompt -->
<meta name="google" content="notranslate">

Microsoft Internet Explorer

<!-- Force IE 8/9/10 to use its latest rendering engine -->
<meta http-equiv="x-ua-compatible" content="ie=edge">

<!-- Disable automatic detection and formatting of possible phone numbers by Skype Toolbar browser extension -->
<meta name="skype_toolbar" content="skype_toolbar_parser_compatible">

<!-- Windows Tiles -->
<meta name="msapplication-config" content="/browserconfig.xml">

Minimum required xml markup for browserconfig.xml:

<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
   <msapplication>
     <tile>
        <square70x70logo src="small.png"/>
        <square150x150logo src="medium.png"/>
        <wide310x150logo src="wide.png"/>
        <square310x310logo src="large.png"/>
     </tile>
   </msapplication>
</browserconfig>

⬆ back to top

Browsers (Chinese)

360 Browser

<!-- Select rendering engine order -->
<meta name="renderer" content="webkit|ie-comp|ie-stand">

QQ Mobile Browser

<!-- Locks the screen into the specified orientation -->
<meta name="x5-orientation" content="landscape/portrait">

<!-- Display this document in fullscreen -->
<meta name="x5-fullscreen" content="true">

<!-- Document will be displayed in "application mode" (fullscreen, etc.) -->
<meta name="x5-page-mode" content="app">

UC Mobile Browser

<!-- Locks the screen into the specified orientation -->
<meta name="screen-orientation" content="landscape/portrait">

<!-- Display this document in fullscreen -->
<meta name="full-screen" content="yes">

<!-- UC browser will display images even if in "text mode" -->
<meta name="imagemode" content="force">

<!-- Document will be displayed in "application mode"(fullscreen, forbidding gesture, etc.) -->
<meta name="browsermode" content="application">

<!-- Disabled the UC browser's "night mode" for this document -->
<meta name="nightmode" content="disable">

<!-- Simplify the document to reduce data transfer -->
<meta name="layoutmode" content="fitscreen">

<!-- Disable the UC browser's feature of "scaling font up when there are many words in this document" -->
<meta name="wap-font-scale" content="no">

⬆ back to top

App Links

<!-- iOS -->
<meta property="al:ios:url" content="applinks://docs">
<meta property="al:ios:app_store_id" content="12345">
<meta property="al:ios:app_name" content="App Links">

<!-- Android -->
<meta property="al:android:url" content="applinks://docs">
<meta property="al:android:app_name" content="App Links">
<meta property="al:android:package" content="org.applinks">

<!-- Web fall back -->
<meta property="al:web:url" content="https://applinks.org/documentation">

⬆ back to top

Other Resources

⬆ back to top

Related Projects

⬆ back to top

Other Formats

⬆ back to top

🌐 Translations

⬆ back to top

🤝 Contributing

Open an issue or a pull request to suggest changes or additions.

Guide

The HEAD repository consists of two branches:

1. master

This branch consists of the README.md file that is reflected on the htmlhead.dev website. All changes to the content of the guide should be made in this file.

Please follow these steps for pull requests:

{:.list-style-default}

  • Modify only one tag, or one related set of tags at a time
  • Use double quotes on attributes
  • Don't include a trailing slash in self-closing elements — the HTML5 spec says they're optional
  • Consider including a link to documentation that supports your change

2. gh-pages

This branch is responsible for the htmlhead.dev website. We use Jekyll to deploy the README.md markdown file to GitHub Pages. All website related modifications should be made in this branch.

You may find it helpful to review the Jekyll Docs and understand how Jekyll works before working in this branch.

🌟 Contributors

Check out all the super awesome contributors 🤩

👤 Author

Josh Buchea

💛 Support

If this project was helpful for you or your organization, please considering supporting my work directly:

Everything helps, thanks! 🙏

— Josh

📝 License

CC0

⬆ back to top

head's People

Contributors

beeva-miguelsarries avatar bhaskarmelkani avatar cryogenic-ric avatar davidpelayo avatar doobix avatar faraixyz avatar jasonkarns avatar jordanbrauer avatar joshbuchea avatar joshuahess avatar justmarkup avatar khaosdoctor avatar konfuze avatar lutece avatar marcobiedermann avatar mcecode avatar ngyikp avatar rdil avatar safaring avatar saijogeorge avatar sarbbottam avatar scottaohara avatar spekulatius avatar thatchej avatar tibor avatar tomlutzenberger avatar toshihidetagami avatar vrq avatar xtuc avatar yiqinzhao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

head's Issues

Favicon section is not up-to-date

Why keeping the favicon section just for MS?

  • missing android, apple, browsers, new sizes for ms ie 11...
    As explained in #51, the order is important, some are omitted because other icons can be used automatically...
    bitsofco.de is also omitting a lot of cases and bugs-workarounds.

In #51, I think, the only missing are the new sizes for MS IE 11.

meta name=robots is not deprecated

AFAIK meta name=robots is still the preferred way to tell Google and other search engines to crawl and/or include a page in their index or not. It is also neither deprecated nor is it ignored by the crawlers.

Your mentioned alternatives do something completely different. If you want to remove pages from the Google index for example it doesn't help to prevent the bot from accessing the pages (either via robots.txt or .htaccess), you will only prevent the pages from getting updated in this way, but they will still remain in the Google index forever. The only way to do this is via this meta tag (also recommended by Google: https://support.google.com/webmasters/answer/93710?hl=en).

Where exactly did you get the idea that it is deprecated and ignored by bots?

OpenSearch

http://www.opensearch.org/Home

Link to the opensearch xml manifest in the HEAD and this allows browsers to trigger a search on your site directly from their address bar.

That's how this works:
image

OEmbed

http://oembed.com/

The generic, standard spec for embedding rich data about links without coupling to site specific (Facebook, Twitter, etc) elements

<meta name="robots" content="noodp">

You should add:

<meta name="robots" content="noodp">

to turn off getting your meta description and other data from DMOZ, and other defunct directories.

Few more

Split into files

This is pretty awesome! I usually end of having a ton a gists with different things in them.

I was wondering if there is any plan to break these out into files? Then the can be pulled directly into a project via their https://raw.githubusercontent.com URL.

I use a plugin for Sublime Text that lets me fetch a URL and copy the contents to the current window. This would be a good project to have a bunch of snippets of text for.

For example, if you are only interested in adding the head meta for Apple iOS, then you could just request the contents of that single file/piece.

Is there any interest in that type of workflow for anyone else?

wait

this will convince people to put several megabytes of boilerplate structure in their documents for absolutely no gain

Meta tag keywords

<meta name="keywords" content="your,keywords,here,comma,separated,no,spaces">

Seems that this meta is no longer used by search engines

WebMentions

https://github.com/converspace/webmention

Webmention is a simple way to automatically notify any URL when you link to it on your site. From the receivers perpective, it's a way to request notification when other sites link to it.

It’s a modern alternative to Pingback and other forms of Linkback.

Note that the latest, most up-to-date specification is located on the IndieWebCamp wiki.

Of course, could add pingback links, too.

What about all 'doctype'

Not really in the head tag, but in the head of the html :-)
Still some even for html5, see w3org to support old browsers I think.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

HTML + SVG 1.1 + MathML 3.0
HTML + SVG 1.1 + MathML 3.0 + ITS 2.0
HTML + SVG 1.1 + MathML 3.0 + RDFa Lite 1.1
HTML 4.01 Strict + URL / XHTML 1.0 Strict + URL
HTML 4.01 Transitional + URL / XHTML 1.0 Transitional + URL
HTML 4.01 Frameset + URL / XHTML 1.0 Frameset + URL
XHTML + SVG 1.1 + MathML 3.0
XHTML + SVG 1.1 + MathML 3.0 + RDFa Lite 1.1
XHTML 1.0 Strict + URL + Ruby + SVG 1.1 + MathML 3.0
SVG 1.1 + URL + XHTML + MathML 3.0

add explanation for each item

This is great work, but it would be great if each item has an explanation for the reason to use (or not). Some items may not apply in particular cases and having an explanation would help decide when to use it.

One example, if I'm not providing a feed, then alternate links would not apply.

Sizes attribute for apple-touch-icon?

Is it worth noting that the apple-touch-icon can be defined multiple times for different sizes through either the file name or the sizes attribute?

For instance, Real Favicon Generator spits out icons at 57x57, 60x60, 72x72, 76x76, 114x114, 120x120, 144x144, 152x152, and 180x180 to cover the gamut of iOS icon sizes and outputs the link elements like so:

<link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png">

Windows 9.1

I guess I completely missed Windows 9 😆

Microsoft Internet Explorer

<!-- IE 11 / Windows 9.1 -->
<meta name="msapplication-config" content="ieconfig.xml">

Believe that should probably be changed

DNS prefetching

As you mentioned

"A list of everything that could go in your head"

.
So, why not include DNS prefetching to it as it is quite an important one.

Script element section

It's probably worth expanding on the script element.

At the very least I'd mention that <script src="..."></script> blocks content rendering while the script loads and executes, and add a non-blocking example with <script async src="..."></script>.

The scope of this project is not to explain every feature of each element that can go in <head>, but for important features it's probably a good idea to mention best practices.

IndieAuth

https://indieauth.com/

IndieAuth is a way to use your own domain name to sign in to websites. It works by linking your website to one or more authentication providers such as Twitter or Google, then entering your domain name in the login form on websites that support IndieAuth.

Section for legacy or situational meta?

In doing a bunch of research on meta elements, I was thinking that it may make sense to section out some of the meta content into different buckets of usefulness / don't-use categories.

For example, the following meta data I've found to not really be recommended for inclusion in the head, as there are better ways to declare this sort of information:

<meta name="language" content="en">

Used to declare a language for the document, but is not really well supported. It's better to use <html lang="">

<meta name="robots" content="index,follow">

Often ignored by search engines, it's far more beneficial to use a robots.txt file or to modify the .htaccess file instead.

<meta name="revised" content="Sunday, July 18th, 2010, 5:15 pm">

There's no real evidence that this is actually used by any search engines. Instead set a published or edited date in the mark-up.

<meta name="reply-to" content="[email protected]">

Don't use this, use a contact page instead. Doing this provides an easy way for malicious bots to scrape emails from websites

<meta name="author" content="name, [email protected]">
<meta name="designer" content="">
<meta name="owner" content="">

Use a <link rel="author"> to humans.txt file or author website/page instead.

<meta http-equiv="refresh" content="300;url=https://example.com/">

Google has gone on record of strongly recommending this not being used.
Set up appache redirects instead.

<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">

Better to do caching server side rather than in meta data

I want to be clear that I think these elements should not be removed from the list of meta elements, but that they should instead be sectioned off as meta elements that people could come across, but really shouldn't be used anymore for the reasons mentioned above.

Thanks!

ie = edge

How important is

'meta http-equiv="x-ua-compatible" content="ie=edge">'

It sticks out like a sore thumb in the recommended minimum section as is totally browser specific. That is bad in my mind. If there is an issue it should be resolved by the vendor and be temporary.

Info about gzip + attribute order

@marcobiedermann raised an important issue with #80 regarding gzip and attribute order. Per @scottaohara's recommendation, I would like to:

add a note / section that calls out best practice for actual implementation of these elements, and their attribute order

It would be great if @marcobiedermann wanted to tackle this. But, I'll go ahead and throw a help wanted label on it in case anyone else would like to submit a PR. Thanks!

Order is important

I believe it is still best practice to get the charset and ie=edge tags in the first packet received by the browser. Could the order-dependent things like this be highlighted in a section?

more info comments

hi,

mega thanks for the HEAD build!
but we need more info comments description for the lines!

thanks!

http-equiv

<meta http-equiv="Content-language" content="en-GB">
Specifying the document language. It can be used by search engines when indexing pages.
<meta http-equiv="Content-type" content="text/html>
Specify the type of document.
Both of them used by some search engines.

Curated Sample HEAD

Here is an example of a curated HEAD.
I will give some explanations later or check the respective sites, twitter, fb

NOTE

  • html5, quotes are no more required unless special chars : = ; / (script-type neither)
  • the order of the first line is important for some problematic search engines
  • not all tags are required for twitter, twitter can understand some usual one or og:
  • some twitter content are without a dot!
  • for the icon, that's totally crazy, the block is curated, ~1 year ago, some usual are not missing, order is very important as some are omitted intentionally, I'll try to find the site to produce and the explanations, need to be enhanced as MS 10 has new one.
  • and for SEO, length, type, etc of the contents are important
<!doctype html>
<html lang=fr prefix="og: http://ogp.me/ns#">
<head>
<meta http-equiv=X-UA-Compatible content="IE=edge">
<meta charset=utf-8>
<meta name=viewport content="width=device-width,initial-scale=1.0">
<meta http-equiv=content-type content="text/html;charset=utf-8">

<title>Stop wasting paper</title>
<meta name=description content="How can we stop wasting paper at the office">
<meta name=keywords content="waste, paper, wasting paper, environment">
<meta name=title content="Stop to waste paper">
<meta name=author content="John Doe">

<meta name=twitter:card content=summary>
<meta name=twitter:site content="@examplecom">
<meta property=og:title content="Stop to waste paper">
<meta property=og:description content="How can we stop wasting paper at the office.">
<meta name=twitter:creator content="@mrjohnnydoe">

<meta property=og:image content="https://www.example.com/apple-touch-icon-180x180.png">
<meta property=og:image:type content="image/png">
<meta property=og:image:width content=180>
<meta property=og:image:height content=180>

<meta property=og:site_name content=example.com>
<meta property=og:url content="https://www.example.com/">
<meta property=og:locale content=fr_FR>
<meta property=og:type content=website>

<meta name=robots content="index,follow">

<link rel=canonical href="https://www.example.com/">

<base href="https://www.example.com/"><!--[if lte IE 6]></base><![endif]-->

<link rel=stylesheet href=mynice.css>

<link rel=apple-touch-icon sizes=57x57 href="/apple-touch-icon-57x57.png">
<link rel=apple-touch-icon sizes=60x60 href="/apple-touch-icon-60x60.png">
<link rel=apple-touch-icon sizes=72x72 href="/apple-touch-icon-72x72.png">
<link rel=apple-touch-icon sizes=76x76 href="/apple-touch-icon-76x76.png">
<link rel=apple-touch-icon sizes=114x114 href="/apple-touch-icon-114x114.png">
<link rel=apple-touch-icon sizes=120x120 href="/apple-touch-icon-120x120.png">
<link rel=apple-touch-icon sizes=144x144 href="/apple-touch-icon-144x144.png">
<link rel=apple-touch-icon sizes=152x152 href="/apple-touch-icon-152x152.png">
<link rel=apple-touch-icon sizes=180x180 href="/apple-touch-icon-180x180.png">
<link rel=icon type="image/png" sizes=16x16 href="/favicon-16x16.png">
<link rel=icon type="image/png" sizes=32x32 href="/favicon-32x32.png">
<link rel=icon type="image/png" sizes=96x96 href="/favicon-96x96.png">
<link rel=icon type="image/png" sizes=194x194 href="/favicon-194x194.png">
<link rel=icon type="image/png" sizes=192x192 href="/android-chrome-192x192.png">
<link rel=manifest href="/manifest.json">
<link rel=mask-icon href="/safari-pinned-tab.svg" color="#ff6600">
<meta name=apple-mobile-web-app-title content=example.com>
<meta name=application-name content=example.com>
<meta name=msapplication-TileColor content="#ffffff">
<meta name=msapplication-TileImage content="/mstile-144x144.png">
<meta name=theme-color content="#ffffff">

</head>
<body>
<p>Hello World!</p>
</body>
</html>

Claim that meta robots is ignored by search engines

Since when does search engines ignore robots in meta tags? I can provide statistical data that they follow it pretty strictly.

If you claim something is deprecated you should provide article that supports your statement and date since when it came to be.

Maybe you shouldn't use the word deprecated at all and just stick to something like: "I/we discourage to use".

Thank you

HTML head elements description

People would like to know where to use each of this elements and why. It would be nice if you added a description for unknown elements

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.