{"id":4857,"date":"2024-04-14T11:03:28","date_gmt":"2024-04-14T03:03:28","guid":{"rendered":"https:\/\/webflow.tenten.co\/?p=4857"},"modified":"2024-04-14T11:03:28","modified_gmt":"2024-04-14T03:03:28","slug":"personalized-code-in-head-and-body-tags","status":"publish","type":"post","link":"https:\/\/webflow.tenten.co\/en\/personalized-code-in-head-and-body-tags\/","title":{"rendered":"Personalized code in head and body tags"},"content":{"rendered":"\n<div class=\"docs_rich-text w-richtext\">\n<p id=\"\">If you have a Core, Growth, Agency, or Freelancer Workspace, or if your website has an active Site plan, you can integrate unique code and scripts that apply to your entire website or specific pages. This can be beneficial for including additional HTML, CSS, and JavaScript.\u00a0<\/p>\n<p id=\"\">You also have the option to utilize the Embed element to incorporate personalized blocks of HTML code into your website design or rich text elements.<\/p>\n<p id=\"\">The following topics will be covered in this tutorial:<\/p>\n<ol id=\"\">\n<li id=\"\">Supported code<\/li>\n<li id=\"\">Personalized code in Site settings<\/li>\n<li id=\"\">Personalized code in Page settings<\/li>\n<li id=\"\">FAQ and problem-solving tips<\/li>\n<\/ol>\n<blockquote id=\"\"><p><strong id=\"\">Important: <\/strong>Personalized code involves advanced modifications that may clash with Webflow\u2019s underlying functionality. Therefore, Webflow cannot ensure the functionality or complete compatibility of any personalized code. Likewise, our support team is not equipped to offer direct assistance with setting up or troubleshooting personalized code since these matters are outside the realm of our customer support policy. If you encounter issues with personalized code, kindly inform us on the <a href=\"https:\/\/discourse.webflow.com\/c\/design-help\/custom-code\/22\" id=\"\">Webflow Forum<\/a>, where the whole Webflow community (including staff) can provide additional assistance and resources.<\/p><\/blockquote>\n<h2 id=\"\">Supported code<\/h2>\n<p id=\"\">The areas for personalized code within Site and Page settings exclusively support <strong id=\"\">HTML<\/strong>, <strong id=\"\">CSS<\/strong>, and <strong id=\"\">JS<\/strong>. Server-side languages (like Perl, PHP, Python, or Ruby) are incompatible with any code section.\u00a0<\/p>\n<h6 id=\"\"><strong id=\"\">Essential to know: <\/strong>The Head code and Footer code sections in Site settings can each accept up to 20,000 characters, while customized code in the &lt;head&gt; tag and before the &lt;\/body&gt; tag in Page settings can accommodate up to 10,000 characters each. If your desired code exceeds these limits, you can store it on another server and reference the script in your personalized code. Utilizing a third-party tool, you can also compress your personalized code.<\/h6>\n<h3 id=\"\">Tags<\/h3>\n<blockquote id=\"\"><p><strong id=\"\">Important:<\/strong> When your personalized code includes opening and\/or closing tags, ensure to include them to maintain proper functionality. Additionally, refrain from including &lt;html&gt;, &lt;body&gt;, or &lt;head&gt; tags in your personalized code, as this will disrupt your website\/layout.<\/p><\/blockquote>\n<h4 id=\"\">Link tag: &lt;link&gt;\u00a0<\/h4>\n<p id=\"\">The <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTML\/Element\/link\" target=\"_blank\" id=\"\" rel=\"noopener\">&lt;link&gt; tag<\/a> establishes a connection between a document and an external resource and should always be placed in the &lt;head&gt; code section.\u00a0<\/p>\n<h4 id=\"\">Meta tag: &lt;meta&gt;\u00a0<\/h4>\n<p id=\"\">The <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTML\/Element\/meta\" target=\"_blank\" id=\"\" rel=\"noopener\">&lt;meta&gt; tag<\/a> offers metadata about your site and should always be placed in the &lt;head&gt; code section.\u00a0<\/p>\n<h4 id=\"\">Style tags: &lt;style&gt;&lt;\/style&gt;<\/h4>\n<p id=\"\">The <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTML\/Element\/style\" target=\"_blank\" id=\"\" rel=\"noopener\">&lt;style&gt;&lt;\/style&gt; tag<\/a> defines additional CSS styles for your site and should always be placed in the &lt;head&gt; code section.\u00a0<\/p>\n<h4 id=\"\">Script tags: &lt;script&gt;&lt;\/script&gt;<\/h4>\n<p id=\"\">The <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTML\/Element\/script\" target=\"_blank\" id=\"\" rel=\"noopener\">&lt;script&gt;&lt;\/script&gt; tag<\/a> enables you to embed JavaScript in your site and can be included in either the &lt;head&gt; code section or before the closing &lt;\/body&gt; tag (i.e., the <strong id=\"\">Footer code<\/strong> section). Nonetheless, positioning your &lt;script&gt;&lt;\/script&gt; tags just before the closing &lt;\/body&gt; tag ensures that your site pages load all their content before the JavaScript is executed, thus aiding in page load speed and enhancing the user experience.\u00a0<\/p>\n<blockquote id=\"\"><p><strong id=\"\">Important:<\/strong> Starting from August 2020, newly published Webflow sites contain <strong id=\"\">jQuery v3.5.1<\/strong>. Importing other versions of jQuery using personalized code may lead to conflicts and unexpected behavior on your site.\u00a0<\/p><\/blockquote>\n<h2 id=\"\">Personalized code in Site settings<\/h2>\n<h3 id=\"\">Head code<\/h3>\n<p id=\"\">Personalized code entered in the <strong id=\"\">Head code<\/strong> section appears before the closing &lt;\/head&gt; tag in your website\u2019s HTML markup and applies to your entire site. The <strong id=\"\">Head code<\/strong> section allows you to link external resources, include metadata, and utilize personalized styles.\u00a0<\/p>\n<h6 id=\"\"><strong id=\"\">Useful to know: <\/strong>Including external &lt;script&gt; tags in the &lt;head&gt; of your site may delay page loading speed. Consider adding the \u201casync\u201d or \u201cdefer\u201d attribute in the &lt;script&gt; tag to boost performance.<\/h6>\n<p id=\"\">To incorporate personalized code in the Head tag:\u00a0<\/p>\n<ol id=\"\">\n<li id=\"\">Go to <strong id=\"\">Site settings<\/strong> &gt; <strong id=\"\">Custom code<\/strong> tab<\/li>\n<li id=\"\">Insert your personalized code in the <strong id=\"\">Head code<\/strong> section<\/li>\n<li id=\"\">Click on <strong id=\"\">Save changes<\/strong><\/li>\n<\/ol>\n<h3 id=\"\">Footer code<\/h3>\n<p id=\"\">Code entered in the <strong id=\"\">Footer code<\/strong> section appears before the closing &lt;\/body&gt; tag in your website\u2019s HTML markup and applies to your entire site.\u00a0<\/p>\n<p id=\"\">To embed personalized code in the Head tag:\u00a0<\/p>\n<ol id=\"\">\n<li id=\"\">Access your <strong id=\"\">Site settings<\/strong> &gt; <strong id=\"\">Custom code<\/strong> tab<\/li>\n<li id=\"\">Include your personalized code in the <strong id=\"\">Footer code<\/strong> section<\/li>\n<li id=\"\">Click on <strong id=\"\">Save changes<\/strong><\/li>\n<\/ol>\n<blockquote id=\"\"><p><strong id=\"\">Important:<\/strong> Personalized scripts will solely be visible on the published site.\u00a0<\/p><\/blockquote>\n<h2 id=\"\">Personalized code in Page settings<\/h2>\n<p id=\"\">The code embedded in the personalized code section of any page will <em id=\"\">exclusively<\/em> relate to that page and will be displayed after any site-wide personalized code in your website&#8217;s HTML markup.\u00a0<\/p>\n<h3 id=\"\">In the &lt;head&gt; tag<\/h3>\n<p id=\"\">&lt;link&gt;, &lt;meta&gt;, and &lt;style&gt;&lt;\/style&gt; tags should always be included within the &lt;head&gt; tag. &lt;script&gt;&lt;\/script&gt; tags can also be placed inside the &lt;head&gt; tag, but positioning scripts before the closing &lt;\/body&gt; tag typically enhances site performance and creates a better experience for your site visitors.\u00a0<\/p>\n<h6 id=\"\"><strong id=\"\">Useful to know: Including external &lt;script&gt; tags in the &lt;head&gt; of your site may slow down page loading. Consider adding the \u201casync\u201d or \u201cdefer\u201d attribute in the &lt;script&gt; tag to enhance performance.<\/strong><\/h6>\n<p id=\"\">To add personalized code within the &lt;head&gt; tag of an individual page:\u00a0<\/p>\n<ol id=\"\">\n<li id=\"\">Launch your site in the Designer<\/li>\n<li id=\"\">Access <strong id=\"\">Page settings<\/strong> for the page where you intend to incorporate your code<\/li>\n<li id=\"\">Insert your personalized code into the <strong id=\"\">Inside &lt;head&gt; tag<\/strong> section under <strong id=\"\">Custom code<\/strong>\u00a0<\/li>\n<li id=\"\">Save your modifications<\/li>\n<\/ol>\n<figure id=\"\" class=\"w-richtext-figure-type-image w-richtext-align-fullwidth\" data-rt-type=\"image\" data-rt-align=\"fullwidth\" data-rt-max-width=\"1501px\">\n<div id=\"\"><img decoding=\"async\" src=\"https:\/\/webflow-s3.tenten.co\/2024\/04\/64b94ad43cf641a923a5bcba_6274207cda736f3e8b975762_f_4aa_v3xxngmi40hgdzpkagcifbn3-aglcombo3j93rq8zfvk9wpt1furzljvnavbp5yh6qr-bknihhdsmlkrfvrlmicc0r8bifu3dxurheplpgs9to6arcwcukg5lhsqmeky5cf4vugbm21w.png\" width=\"auto\" height=\"auto\" loading=\"auto\" alt=\"The \u201cInside &lt;head&gt; tag\u201d section highlighted in page-level custom code settings in the Webflow Designer.\" id=\"\" title=\"64b94ad43cf641a923a5bcba_6274207cda736f3e8b975762_f_4aa_v3xxngmi40hgdzpkagcifbn3-aglcombo3j93rq8zfvk9wpt1furzljvnavbp5yh6qr-bknihhdsmlkrfvrlmicc0r8bifu3dxurheplpgs9to6arcwcukg5lhsqmeky5cf4vugbm21w\"><\/div>\n<\/figure>\n<h3 id=\"\">Before the &lt;\/body&gt; tag<\/h3>\n<pid=\"\">\n<p>&lt;script&gt;&lt;\/script&gt; labels generally belong in this section.\u00a0<\/p>\n<p id=\"\">When wanting to insert personalized code right before the closing &lt;\/body&gt; tag of a specific page:\u00a0<\/p>\n<ol id=\"\">\n<li id=\"\">Access your website in the Designer<\/li>\n<li id=\"\">Navigate to the <strong id=\"\">Page settings<\/strong> for the desired page to insert your code<\/li>\n<li id=\"\">Insert your personalized code into the <strong id=\"\">Before &lt;\/body&gt; tag<\/strong> area under <strong id=\"\">Custom code<\/strong><\/li>\n<li id=\"\">Save your modifications<\/li>\n<\/ol>\n<figure id=\"\" class=\"w-richtext-figure-type-image w-richtext-align-fullwidth\" data-rt-type=\"image\" data-rt-align=\"fullwidth\" data-rt-max-width=\"1501px\">\n<div id=\"\">\n<img decoding=\"async\" src=\"https:\/\/webflow-s3.tenten.co\/2024\/04\/64b94ad43cf641a923a5bcb6_6274207ce19a369b493d735d_wwb0gzil8ds4t-8gvmzrizotkgjxd80leifeph98-aqfuouig-abygqlx3q9p_kcuhj2ieyz5cc-faidfzdx-r3g-nael-dp_vibjlv4-ut6z9rz8ttkzshnbdk0j0xrhuuqzxr1hel310ktza.png\" width=\"auto\" height=\"auto\" loading=\"auto\" alt=\"The \u201cBefore &lt;\/body&gt; tag\u201d section highlighted in page-level custom code settings in the Designer.\" id=\"\" title=\"64b94ad43cf641a923a5bcb6_6274207ce19a369b493d735d_wwb0gzil8ds4t-8gvmzrizotkgjxd80leifeph98-aqfuouig-abygqlx3q9p_kcuhj2ieyz5cc-faidfzdx-r3g-nael-dp_vibjlv4-ut6z9rz8ttkzshnbdk0j0xrhuuqzxr1hel310ktza\"><\/div>\n<\/figure>\n<blockquote id=\"\"><p><strong id=\"\">Note:<\/strong> Personalized scripts are visible solely on the published website.<\/p><\/blockquote>\n<h2 id=\"\">FAQ and issues for resolution<\/h2>\n<h3 id=\"\">Can I utilize server-side languages in my website or page-level bespoke code?\u00a0<\/h3>\n<p id=\"\">You&#8217;re unable to integrate server-side languages (e.g., Perl, PHP, Python, Ruby) via bespoke code. Custom code in Site and Page settings exclusively supports <strong id=\"\">HTML<\/strong>, <strong id=\"\">CSS<\/strong> in &lt;style&gt; labels, and <strong id=\"\">JS<\/strong> in &lt;script&gt; labels.<\/p>\n<h3 id=\"\">Is it possible to extend the maximum character limit for bespoke code?\u00a0<\/h3>\n<p id=\"\">The Head code and Footer code areas in Site settings can handle a maximum of 20,000 characters each, and personalized code in the &lt;head&gt; tag and preceding the &lt;\/body&gt; tag in Page settings can handle a maximum of 10,000 characters each. If your desired code exceeds this length, you can store it on an alternate server and reference the script within your bespoke code. You also have the option to compress your tailored code using a third-party tool.<\/p>\n<h3 id=\"\">Why isn&#8217;t my bespoke code impacting the Designer?\u00a0<\/h3>\n<p id=\"\">Custom scripts will <em id=\"\">exclusively<\/em> show on the published website. These are disabled in the Designer to prevent any unforeseen behavior.<\/p>\n<h3 id=\"\">Assistance needed with bespoke code functionality troubles!\u00a0<\/h3>\n<p id=\"\">Double-check that your code includes the appropriate opening and\/or closing tags and does not contain &lt;html&gt;, &lt;body&gt;, or &lt;head&gt; tags.\u00a0<\/p>\n<p id=\"\">As of August 2020, newly launched Webflow sites come with jQuery v3.5.1. Importing other jQuery versions with bespoke code might result in conflicts and unforeseen behavior on your website. Scripts that impact DOM events like onClick, onHover, etc., could also lead to unforeseen behavior.<\/p>\n<p id=\"\">Remember, bespoke code is an advanced modification that could clash with Webflow&#8217;s foundational operations. Thus, Webflow cannot ensure the functionality or complete compatibility of any tailored code.<\/p>\n<p id=\"\">Our customer service team is unable to directly aid with bespoke code setup or problem-solving since these matters fall outside our customer service guidelines. If you encounter issues with bespoke code, please inform us on the <a href=\"https:\/\/discourse.webflow.com\/c\/design-help\/custom-code\/22\" id=\"\">Webflow Forum<\/a>, where the entire Webflow community (including staff) can offer additional aid and resources.<\/p>\n","protected":false},"excerpt":{"rendered":"Add custom code and scripts that apply to your entire site or individual pages.","protected":false},"author":2,"featured_media":5238,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"om_disable_all_campaigns":false,"inline_featured_image":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"csco_display_header_overlay":false,"csco_singular_sidebar":"","csco_page_header_type":"","footnotes":""},"categories":[286],"tags":[],"class_list":{"0":"post-4857","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-site-settings","8":"cs-entry"},"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/posts\/4857","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/comments?post=4857"}],"version-history":[{"count":0,"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/posts\/4857\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/media\/5290"}],"wp:attachment":[{"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/media?parent=4857"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/categories?post=4857"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/tags?post=4857"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}