{"id":2572,"date":"2025-01-14T14:01:26","date_gmt":"2025-01-14T14:01:26","guid":{"rendered":"https:\/\/www.lcn.com\/support\/?post_type=ht_kb&#038;p=2572"},"modified":"2025-01-14T14:01:27","modified_gmt":"2025-01-14T14:01:27","slug":"how-to-restrict-html-code-according-to-cookie-settings","status":"publish","type":"ht_kb","link":"https:\/\/www.lcn.com\/support\/articles\/how-to-restrict-html-code-according-to-cookie-settings\/","title":{"rendered":"How to Restrict HTML Code According to Cookie Settings"},"content":{"rendered":"\n<div class=\"wp-block-nco-info-block\"><p class=\"nco-info-block-content\"><strong>Info:<\/strong> This article applies to Website Builder purchases made after 14<sup>th<\/sup> January 2025. For further assistance, please contact our support team.<\/p><\/div>\n\n\n\n<p>In this article, you will learn how to<strong> modify the HTML code<\/strong> on your website to control when certain elements are activated based on the cookies that are enabled.&nbsp;<\/p>\n\n\n\n<p>This modification is useful if you&#8217;ve <strong>embedded a widget<\/strong> (via HTML code) that collects cookies. By adjusting the code, you can prevent the widget from running and collecting cookies unless specific cookie consent is given. This applies to both widgets embedded in the page content and HTML code inserted in the page header.&nbsp;<\/p>\n\n\n\n<p>For example, if you&#8217;ve embedded a widget that collects functional cookies, and a visitor doesn&#8217;t allow functional cookies, the widget won&#8217;t display (the code won&#8217;t run).&nbsp;<\/p>\n\n\n\n<p>To restrict the code based on the type of cookie, use the following tags:&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Marketing Cookies<\/h2>\n\n\n\n<p>{IF_ACCEPTED_MARKETING_COOKIES}&nbsp;&nbsp;<\/p>\n\n\n\n<p>HTML code&nbsp;&nbsp;<\/p>\n\n\n\n<p>{\/IF_ACCEPTED_MARKETING_COOKIES}&nbsp;<br>&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Functional Cookies<\/h2>\n\n\n\n<p>{IF_ACCEPTED_FUNCTIONAL_COOKIES}&nbsp;&nbsp;<\/p>\n\n\n\n<p>HTML code&nbsp;&nbsp;<\/p>\n\n\n\n<p>{\/IF_ACCEPTED_FUNCTIONAL_COOKIES}&nbsp;<br>&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Performance Cookies<\/h2>\n\n\n\n<p>{IF_ACCEPTED_PERFORMANCE_COOKIES}&nbsp;&nbsp;<\/p>\n\n\n\n<p>HTML code&nbsp;&nbsp;<\/p>\n\n\n\n<p>{\/IF_ACCEPTED_PERFORMANCE_COOKIES}&nbsp;<br>&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Code Example<\/h2>\n\n\n\n<p>{IF_ACCEPTED_MARKETING_COOKIES}&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<p>&lt;p&gt; This text\/widget will appear &lt;b&gt; only &lt;\/b&gt; if &lt;b&gt; MARKETING COOKIES are accepted &lt;\/b&gt;&lt;\/p&gt;&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<p>{\/IF_ACCEPTED_MARKETING_COOKIES}&nbsp;<\/p>\n\n\n\n<div style=\"height:1px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>If you have any further questions, simply&nbsp;<a href=\"https:\/\/admin.lcn.com\/tech_support\/tracking\/add.php\"><strong>raise a support request<\/strong><\/a>&nbsp;from within your Online Control Panel or call us on&nbsp;<strong>0345 363 3637<\/strong>. Our Support team are here to help and ready to assist you with your enquiry.<\/p>\n\n\n\n<p>For assistance raising a support request please follow the following&nbsp;<a href=\"https:\/\/www.lcn.com\/support\/articles\/how-to-open-a-support-enquiry\/\"><strong>guide<\/strong><\/a><strong>.<\/strong><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, you will learn how to modify the HTML code on your website to control when certain elements are activated based on the cookies that are enabled.&nbsp; This modification is useful if you&#8217;ve embedded a widget (via HTML code) that collects cookies. By adjusting the code, you can prevent the widget from running [&hellip;]<\/p>\n","protected":false},"author":28,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[95,102,103],"ht-kb-tag":[98],"class_list":["post-2572","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-website-builder","ht_kb_category-add-and-edit-content","ht_kb_category-content","ht_kb_tag-website-builder"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Restrict HTML Code According to Cookie Settings - Customer Support Guides - LCN<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.lcn.com\/support\/articles\/how-to-restrict-html-code-according-to-cookie-settings\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Restrict HTML Code According to Cookie Settings - Customer Support Guides - LCN\" \/>\n<meta property=\"og:description\" content=\"In this article, you will learn how to modify the HTML code on your website to control when certain elements are activated based on the cookies that are enabled.&nbsp; This modification is useful if you&#8217;ve embedded a widget (via HTML code) that collects cookies. By adjusting the code, you can prevent the widget from running [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.lcn.com\/support\/articles\/how-to-restrict-html-code-according-to-cookie-settings\/\" \/>\n<meta property=\"og:site_name\" content=\"Customer Support Guides - LCN\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/lcndotcom\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-14T14:01:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.lcn.com\/support\/wp-content\/uploads\/support-facebook-feed.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@lcndotcom\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.lcn.com\/support\/articles\/how-to-restrict-html-code-according-to-cookie-settings\/\",\"url\":\"https:\/\/www.lcn.com\/support\/articles\/how-to-restrict-html-code-according-to-cookie-settings\/\",\"name\":\"How to Restrict HTML Code According to Cookie Settings - Customer Support Guides - LCN\",\"isPartOf\":{\"@id\":\"https:\/\/www.lcn.com\/support\/#website\"},\"datePublished\":\"2025-01-14T14:01:26+00:00\",\"dateModified\":\"2025-01-14T14:01:27+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.lcn.com\/support\/articles\/how-to-restrict-html-code-according-to-cookie-settings\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.lcn.com\/support\/articles\/how-to-restrict-html-code-according-to-cookie-settings\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.lcn.com\/support\/articles\/how-to-restrict-html-code-according-to-cookie-settings\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.lcn.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Restrict HTML Code According to Cookie Settings\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.lcn.com\/support\/#website\",\"url\":\"https:\/\/www.lcn.com\/support\/\",\"name\":\"Customer Support Guides - LCN\",\"description\":\"- LCN\",\"publisher\":{\"@id\":\"https:\/\/www.lcn.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.lcn.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.lcn.com\/support\/#organization\",\"name\":\"LCN.com\",\"url\":\"https:\/\/www.lcn.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.lcn.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.lcn.com\/support\/wp-content\/uploads\/2020\/02\/ZF_-hcc3.jpg\",\"contentUrl\":\"https:\/\/www.lcn.com\/support\/wp-content\/uploads\/2020\/02\/ZF_-hcc3.jpg\",\"width\":461,\"height\":461,\"caption\":\"LCN.com\"},\"image\":{\"@id\":\"https:\/\/www.lcn.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/lcndotcom\",\"https:\/\/x.com\/lcndotcom\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Restrict HTML Code According to Cookie Settings - Customer Support Guides - LCN","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.lcn.com\/support\/articles\/how-to-restrict-html-code-according-to-cookie-settings\/","og_locale":"en_US","og_type":"article","og_title":"How to Restrict HTML Code According to Cookie Settings - Customer Support Guides - LCN","og_description":"In this article, you will learn how to modify the HTML code on your website to control when certain elements are activated based on the cookies that are enabled.&nbsp; This modification is useful if you&#8217;ve embedded a widget (via HTML code) that collects cookies. By adjusting the code, you can prevent the widget from running [&hellip;]","og_url":"https:\/\/www.lcn.com\/support\/articles\/how-to-restrict-html-code-according-to-cookie-settings\/","og_site_name":"Customer Support Guides - LCN","article_publisher":"https:\/\/www.facebook.com\/lcndotcom","article_modified_time":"2025-01-14T14:01:27+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/www.lcn.com\/support\/wp-content\/uploads\/support-facebook-feed.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_site":"@lcndotcom","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.lcn.com\/support\/articles\/how-to-restrict-html-code-according-to-cookie-settings\/","url":"https:\/\/www.lcn.com\/support\/articles\/how-to-restrict-html-code-according-to-cookie-settings\/","name":"How to Restrict HTML Code According to Cookie Settings - Customer Support Guides - LCN","isPartOf":{"@id":"https:\/\/www.lcn.com\/support\/#website"},"datePublished":"2025-01-14T14:01:26+00:00","dateModified":"2025-01-14T14:01:27+00:00","breadcrumb":{"@id":"https:\/\/www.lcn.com\/support\/articles\/how-to-restrict-html-code-according-to-cookie-settings\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.lcn.com\/support\/articles\/how-to-restrict-html-code-according-to-cookie-settings\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.lcn.com\/support\/articles\/how-to-restrict-html-code-according-to-cookie-settings\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.lcn.com\/support\/"},{"@type":"ListItem","position":2,"name":"How to Restrict HTML Code According to Cookie Settings"}]},{"@type":"WebSite","@id":"https:\/\/www.lcn.com\/support\/#website","url":"https:\/\/www.lcn.com\/support\/","name":"Customer Support Guides - LCN","description":"- LCN","publisher":{"@id":"https:\/\/www.lcn.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.lcn.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.lcn.com\/support\/#organization","name":"LCN.com","url":"https:\/\/www.lcn.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.lcn.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.lcn.com\/support\/wp-content\/uploads\/2020\/02\/ZF_-hcc3.jpg","contentUrl":"https:\/\/www.lcn.com\/support\/wp-content\/uploads\/2020\/02\/ZF_-hcc3.jpg","width":461,"height":461,"caption":"LCN.com"},"image":{"@id":"https:\/\/www.lcn.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/lcndotcom","https:\/\/x.com\/lcndotcom"]}]}},"_links":{"self":[{"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/ht-kb\/2572","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/users\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/comments?post=2572"}],"version-history":[{"count":2,"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/ht-kb\/2572\/revisions"}],"predecessor-version":[{"id":2782,"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/ht-kb\/2572\/revisions\/2782"}],"wp:attachment":[{"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/media?parent=2572"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/ht-kb-category?post=2572"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/ht-kb-tag?post=2572"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}