{"id":2091,"date":"2022-09-24T12:49:08","date_gmt":"2022-09-24T12:49:08","guid":{"rendered":"https:\/\/afreeurl.com\/optimize-the-html-head-element-for-a-high-performing-website\/"},"modified":"2022-09-24T12:49:08","modified_gmt":"2022-09-24T12:49:08","slug":"optimize-the-html-head-element-for-a-high-performing-website","status":"publish","type":"post","link":"https:\/\/afreeurl.com\/?p=2091","title":{"rendered":"Optimize the HTML Head element for a high performing website"},"content":{"rendered":"<p><\/p>\n<p><span><span><span><span><span><span>The HTML <\/span><\/span><\/span><\/span><\/span><\/span><head><span><span><span><span><span><span>    The element is essential for web developers and other Internet technologists.  The <\/span><\/span><\/span><\/span><\/span><\/span><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTML\" target=\"_blank\" rel=\"noopener\"><span><span><span><span><span><span><span>HTML<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/a><span><span><span><span><span><span><span> <\/span><\/span><\/span><\/span><\/span><\/span><\/span><head><span><span><span><span><span><span>    The element contains machine-readable information (<\/span><\/span><\/span><\/span><\/span><\/span><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Glossary\/Metadata\" target=\"_blank\" rel=\"noopener\"><span><span><span><span><span><span><span>metadata<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/a><span><span><span><span><span><span>) on the document, like yours <\/span><\/span><\/span><\/span><\/span><\/span><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTML\/Element\/title\" target=\"_blank\" rel=\"noopener\"><span><span><span><span><span><span><span>title<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/a><span><span><span><span><span><span>, <\/span><\/span><\/span><\/span><\/span><\/span><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTML\/Element\/script\" target=\"_blank\" rel=\"noopener\"><span><span><span><span><span><span><span>scripts<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/a><span><span><span><span><span><span>i <\/span><\/span><\/span><\/span><\/span><\/span><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTML\/Element\/style\" target=\"_blank\" rel=\"noopener\"><span><span><span><span><span><span><span>style sheets<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/a><span><span><span><span><span><span>.  Websites that do not implement this information correctly will rank poorly in SEO, cannot be shared across the Internet by other websites, and may not translate correctly in modern browsers.  Getting this element right can mean the difference between life and death for an internet business, especially because of how important this element is to the discoverability of your website by search engines. .  <\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n<p class=\"bix-embed-read-more\"><span><span>Read more from Alex Zito on the Built In Expert Contributor Network<\/span>Why is the internet so slow?  (And how we can fix it.)<\/span><\/p>\n<\/p>\n<h2><span><span><span><span><span><span>How the HTML Head element is classified<\/span><\/span><\/span><\/span><\/span><\/span><\/h2>\n<p><span><span><span><span><span><span>The HTML specification defines categories for each HTML element and describes the position the element can fit in the document.  The head element doesn&#8217;t actually fall under any HTML tag category, but it also needs to be the first child of the <\/span><\/span><\/span><\/span><\/span><\/span><head><span><span><span><span><span><span>    tag, placing it in a unique position in the HTML language.<\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n<p><span><span><span><span><span><span>Inside the head element there should be <\/span><\/span><\/span><\/span><\/span><\/span><a href=\"https:\/\/html.spec.whatwg.org\/multipage\/dom.html#metadata-content-2\" target=\"_blank\" rel=\"noopener\"><span><span><span><span><span><span><span>metadata<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/a><span><span><span><span><span><span>    tags, scripts, and links: Content that describes document details and links to external resources.<\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n<p class=\"bix-embed-read-more\"><span><span>Learn more about HTML in the Built In Expert Contributor Network<\/span>You need to learn HTML again<\/span><\/p>\n<\/p>\n<h2><span><span><span><span><span><span>Links and Scripts <\/span><\/span><\/span><\/span><\/span><\/span><\/h2>\n<p><span><span><span><span><span><span>When one <\/span><\/span><\/span><\/span><\/span><\/span><a href=\"https:\/\/tinycode.medium.com\/you-need-to-relearn-html-43509084e987\" target=\"_blank\" rel=\"noopener\"><span><span><span><span><span><span><span>user agent<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/a><span><span><span><span><span><span>    downloads and analyzes your web page, one of the first things it will do, even before rendering your page, is follow the links and scripts of the <\/span><\/span><\/span><\/span><\/span><\/span><head><span><span><span><span><span><span>    tag and to download and run the content there. <\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n<p><span><span><span><span><span><span>The <\/span><\/span><\/span><\/span><\/span><\/span><link><span><span><span><span><span><span>    element is most commonly used to link to stylesheets, but is also used to set site icons (both &#8220;favicon&#8221; style icons and icons for the home screen and apps on mobile devices), between other things. <\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n<link href=\"https:\/\/builtin.com\/media\/examples\/link-element-example.css\" rel=\"stylesheet\">\n<p><span><span><span><span><span><span>The <\/span><\/span><\/span><\/span><\/span><\/span><script><span><span><span><span><span><span> element is used to download javascript from external sources, and is more commonly included in the <\/span><\/span><\/span><\/span><\/span><\/span><body><span><span><span><span><span><span> element as opposed to the head.<\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n<p><script src=\"https:\/\/builtin.com\/software-engineering-perspectives\/javascript.js\"><\/script><\/p>\n<p class=\"bix-embed-read-more\"><span><span>Learn more about HTML and JavaScript at BuiltIn.com<\/span>InnerText vs.  InnerHTML vs.  TextContent: What's Best?<\/span><\/p>\n<\/p>\n<h2><span><span><span><span><span><span>meta tags<\/span><\/span><\/span><\/span><\/span><\/span><\/h2>\n<p><span><span><span><span><span><span>The main category of information included in the header element of an HTML document is meta tags.  Meta tags are HTML elements that describe information about a web page unrelated to the visual representation of the page, such as the page's title, its language, and the website's description.  Meta tags are very important for search engine optimization, as they are read by web crawlers that document website content for search engines such as Google, Yandex or Bing. <\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n<h2 class=\"title\">Types of meta tags<\/h2>\n<p>TitleDescriptionCharsetAlternate and canonicalSocial or sharedOG social<\/p>\n<h3><span><span><span><span><span><span>The title tag<\/span><\/span><\/span><\/span><\/span><\/span><\/h3>\n<p><span><span><span><span><span><span>The first and most important meta tag is the <\/span><\/span><\/span><\/span><\/span><\/span><a href=\"https:\/\/html.spec.whatwg.org\/multipage\/semantics.html#the-title-element\" target=\"_blank\" rel=\"noopener\"><span><span><span><span><span><span><span>page title<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/a><span><span><span><span><span><span>.  This tag defines the text that is displayed on the tab when a user opens your web page and also defines the text that will appear in Google or other web searches on your web page.  You define it as follows: <\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n<p><title>Introduction to bee mating rituals<\/title><\/p>\n<h3><span><span><span><span><span><span>The description tag<\/span><\/span><\/span><\/span><\/span><\/span><\/h3>\n<p><span><span><span><span><span><span>The description tag defines the content of the web page in written words and will often be included in the search results of your website.<\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n<p><meta name=\u201cdescription\u201d value=\u201cThis is a webpage about lord of the rings\u201d\/><\/p>\n<h3><span><span><span><span><span><span>The Charset label<\/span><\/span><\/span><\/span><\/span><\/span><\/h3>\n<p><span><span><span><span><span><span>The <\/span><\/span><\/span><\/span><\/span><\/span><charset><span><span><span><span><span><span>    The tag describes what the character encoding of the website is, for example, the most common character encoding is utf-8.  A character set describes the mapping of the words you type in your HTML document to the characters they represent.  For example, if you were to change the character encoding from UTF-8 to ASCII, any emoji you added to your web page would not be displayed because the ASCII mapping does not include those characters.<\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n<p><meta charset=\"utf-8\"><\/p>\n<h3><span><span><span><span><span><span>Alternatives and canonical tags<\/span><\/span><\/span><\/span><\/span><\/span><\/h3>\n<p><span><span><span><span><span><span>Alternative and canonical tags define the different language versions of your web page.  For example: <\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n<link rel=\"alternate\" href=\"https:\/\/www.italki.com\/ar\" hreflang=\"ar\">\n<link rel=\"canonical\" href=\"https:\/\/www.italki.com\/en\">\n<p><span><span><span><span><span><span>These tags are very important because they allow internet crawlers to understand where your content is coming from.<\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n<p><span><span><span><span><span><span> <\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n<h3><span><span><span><span><span><span>Social or sharing tags<\/span><\/span><\/span><\/span><\/span><\/span><\/h3>\n<p><span><span><span><span><span><span>Social or sharing tags are a class of custom meta tags that are intended to allow social networking sites like Twitter, Facebook, and the like to allow richer content about your web page on their sites.  Social networking websites, like search engines, also crawl web pages on the Internet, and their crawlers use these special tags to decide what information to add to posts.  The content of these tags will ultimately determine, for example, the thumbnail images that will be displayed when people share your web page on these social platforms.<\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n<\/p>\n<h4><span><span><span><span><span><span>And Social Labels<\/span><\/span><\/span><\/span><\/span><\/span><\/h4>\n<p><span><span><span><span><span><span>OG tags are a custom set of meta tags based on <\/span><\/span><\/span><\/span><\/span><\/span><a href=\"https:\/\/ogp.me\/\" target=\"_blank\" rel=\"noopener\"><span><span><span><span><span><span><span>opengraph protocol<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/a><span><span><span><span><span><span>.  They are the most accepted social meta tag, and most social media sites will honor it.  An OG tag is added to your website by adding the following within your <\/span><\/span><\/span><\/span><\/span><\/span><head><span><span><span><span><span><span>:<\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n<p><meta property=\"og:title\" content=\"The Rock\" \/><\/p>\n<p><span><span><span><span><span><span>There is a long list of accepted OG tags, which can be seen on the opengraph website<\/span><\/span><\/span><\/span><\/span><\/span><span><span><span><span><span><span>.  They include: <\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n<p><og:type><span><span><span><span><span><span>    The type of your object, for example \"video.movie\" <\/span><\/span><\/span><\/span><\/span><\/span><og:image><span><span><span><span><span><span>    An image URL that should represent your object within the chart <\/span><\/span><\/span><\/span><\/span><\/span><og:url><span><span><span><span><span><span>    The canonical URL of your object that will be used as a permanent identifier in the graph<\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n<h4><span><span><span><span><span><span>Twitter social tags<\/span><\/span><\/span><\/span><\/span><\/span><\/h4>\n<p><span><span><span><span><span><span>Twitter tags are very similar to og tags, although they are primarily read by Twitter crawlers.  They have a similar set of properties to og tags, and are even written the same way.  An example Twitter hashtag might look like a <\/span><\/span><\/span><\/span><\/span><\/span><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-add-twitter-card-and-open-graph-social-metadata-to-your-webpage-with-html\" target=\"_blank\" rel=\"noopener\"><span><span><span><span><span><span><span>Next<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/a><span><span><span><span><span><span>: <\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n<p><meta name=\"twitter:title\" content=\"Sammy the Shark\" \/><\/p>\n<p><span><span><span><span><span><span>Other tags include <\/span><\/span><\/span><\/span><\/span><\/span><twitter:site><span><span><span><span><span><span>, <\/span><\/span><\/span><\/span><\/span><\/span><twitter:card><span><span><span><span><span><span>i <\/span><\/span><\/span><\/span><\/span><\/span><twitter:creator><span><span><span><span><span><span>all of which send signals about what to add to your site when others share a link to your site. <\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n<p class=\"bix-embed-read-more\"><span><span>More from Alex Zito on Built In<\/span>The back-end technology that front-end developers need to know<\/span><\/p>\n<p>[ad_2]<br \/>\n<br \/><a href=\"https:\/\/builtin.com\/software-engineering-perspectives\/html-head-element\" target=\"_blank\" rel=\"noopener\">Source link <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The HTML The element is essential for web developers and other Internet technologists. The HTML The element contains machine-readable information (metadata) on the document, like yours title, scriptsi style sheets. Websites that do not implement this information correctly will rank poorly in SEO, cannot be shared across the Internet by other websites, and may not translate correctly in modern browsers. Getting this element right can mean the difference between life and death for an internet&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2091","post","type-post","status-publish","format-standard","hentry","category-seo-news"],"_links":{"self":[{"href":"https:\/\/afreeurl.com\/index.php?rest_route=\/wp\/v2\/posts\/2091","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afreeurl.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afreeurl.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afreeurl.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afreeurl.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2091"}],"version-history":[{"count":0,"href":"https:\/\/afreeurl.com\/index.php?rest_route=\/wp\/v2\/posts\/2091\/revisions"}],"wp:attachment":[{"href":"https:\/\/afreeurl.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2091"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afreeurl.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2091"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afreeurl.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2091"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}