{"id":5667,"date":"2026-11-05T10:46:35","date_gmt":"2026-11-05T10:46:35","guid":{"rendered":"https:\/\/shapekode.com\/product\/shapeblock\/docs\/custom-code\/"},"modified":"2026-11-08T11:39:19","modified_gmt":"2026-11-08T11:39:19","password":"","slug":"custom-code","status":"publish","type":"docs","link":"https:\/\/shapekode.com\/product\/shapeblock\/docs\/custom-code\/","title":{"rendered":"Custom Code"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The Custom Code extension prints code you paste into the header or footer of your site, without editing a theme file. Use it for Google Analytics, Google Tag Manager, Search Console verification, a pixel or a live chat.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">See it on the <a href=\"https:\/\/shapekode.com\/product\/shapeblock\/custom-code\/\">Custom Code demo page<\/a>. The chat bubble on that page was added with this extension.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"How to Add Google Analytics or Live Chat Code in WordPress | ShapeBlock Pro Custom Code\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/ZclYjyToX4E?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">How to Add Custom Code<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Turn It On<\/h3>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>In your dashboard, open <strong>ShapeBlock \u203a Extensions<\/strong>.<\/li>\n\n\n<li>Find the <strong>Custom Code<\/strong> card and switch it on.<\/li>\n\n\n<li>Click the gear on the card to open its settings.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"940\" height=\"548\" src=\"https:\/\/shapekode.com\/product\/shapeblock\/wp-content\/uploads\/2026\/11\/custom-code-card-c01fbe.webp\" alt=\"The Custom Code card on the Extensions page\" class=\"wp-image-5674\" srcset=\"https:\/\/shapekode.com\/product\/shapeblock\/wp-content\/uploads\/2026\/11\/custom-code-card-c01fbe.webp 940w, https:\/\/shapekode.com\/product\/shapeblock\/wp-content\/uploads\/2026\/11\/custom-code-card-c01fbe-300x175.webp 300w, https:\/\/shapekode.com\/product\/shapeblock\/wp-content\/uploads\/2026\/11\/custom-code-card-c01fbe-768x448.webp 768w, https:\/\/shapekode.com\/product\/shapeblock\/wp-content\/uploads\/2026\/11\/custom-code-card-c01fbe-600x350.webp 600w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Paste Your Code<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Paste the code into the box it belongs in, with its own script tags. The grey text in an empty box is only an example of how the code looks, and it is never saved.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"720\" height=\"1030\" src=\"https:\/\/shapekode.com\/product\/shapeblock\/wp-content\/uploads\/2026\/11\/custom-code-settings-34e0ac.webp\" alt=\"The Custom Code settings with three code boxes\" class=\"wp-image-5676\" srcset=\"https:\/\/shapekode.com\/product\/shapeblock\/wp-content\/uploads\/2026\/11\/custom-code-settings-34e0ac.webp 720w, https:\/\/shapekode.com\/product\/shapeblock\/wp-content\/uploads\/2026\/11\/custom-code-settings-34e0ac-210x300.webp 210w, https:\/\/shapekode.com\/product\/shapeblock\/wp-content\/uploads\/2026\/11\/custom-code-settings-34e0ac-716x1024.webp 716w, https:\/\/shapekode.com\/product\/shapeblock\/wp-content\/uploads\/2026\/11\/custom-code-settings-34e0ac-600x858.webp 600w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Header (inside &lt;head&gt;):<\/strong> Google Analytics, Google Tag Manager, Search Console verification, a Meta or LinkedIn pixel.<\/li>\n\n\n<li><strong>After the opening &lt;body&gt; tag:<\/strong> The noscript part of Google Tag Manager. If your theme does not support this spot, the code is printed in the footer instead.<\/li>\n\n\n<li><strong>Footer (before &lt;\/body&gt;):<\/strong> A live chat such as Tawk.to or Crisp, a cookie banner, or any script that should load last.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Save and Check<\/h3>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>Click <strong>Save Changes<\/strong>.<\/li>\n\n\n<li>Open your site in a private window, so you see it as a visitor does.<\/li>\n\n\n<li>If you use a caching plugin, clear its cache first.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Settings<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"680\" height=\"201\" src=\"https:\/\/shapekode.com\/product\/shapeblock\/wp-content\/uploads\/2026\/11\/custom-code-options-c2235b.webp\" alt=\"Leave Out Administrators and Show On\" class=\"wp-image-5675\" srcset=\"https:\/\/shapekode.com\/product\/shapeblock\/wp-content\/uploads\/2026\/11\/custom-code-options-c2235b.webp 680w, https:\/\/shapekode.com\/product\/shapeblock\/wp-content\/uploads\/2026\/11\/custom-code-options-c2235b-300x89.webp 300w, https:\/\/shapekode.com\/product\/shapeblock\/wp-content\/uploads\/2026\/11\/custom-code-options-c2235b-600x177.webp 600w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Leave Out Administrators:<\/strong> Logged-in administrators do not get the code, so your own visits do not count in your analytics. Turn it off if you need to test the code while logged in.<\/li>\n\n\n<li><strong>Show On:<\/strong> All pages, or Selected pages only, such as a thank-you page with a conversion tag. With Selected pages the code does not run on posts or archives.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">If a Script Does Not Run<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Code copied from a blog or a document often picks up curly quotes, and a script with curly quotes does not run. When a box has them, a warning appears under it. Click <strong>Fix Quotes<\/strong> to turn them into straight quotes.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"672\" height=\"295\" src=\"https:\/\/shapekode.com\/product\/shapeblock\/wp-content\/uploads\/2026\/11\/custom-code-warning-d95760.webp\" alt=\"The curly quotes warning with the Fix Quotes button\" class=\"wp-image-5664\" srcset=\"https:\/\/shapekode.com\/product\/shapeblock\/wp-content\/uploads\/2026\/11\/custom-code-warning-d95760.webp 672w, https:\/\/shapekode.com\/product\/shapeblock\/wp-content\/uploads\/2026\/11\/custom-code-warning-d95760-300x132.webp 300w, https:\/\/shapekode.com\/product\/shapeblock\/wp-content\/uploads\/2026\/11\/custom-code-warning-d95760-600x263.webp 600w\" sizes=\"auto, (max-width: 672px) 100vw, 672px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Good to Know<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Only an administrator allowed to post unfiltered HTML can see or change the code. On a multisite network that is a super admin.<\/li>\n\n\n<li>The code is printed exactly as you paste it, so use only code from a service you trust.<\/li>\n\n\n<li>It runs on your site&#8217;s pages only, never in wp-admin or on the login page.<\/li>\n\n\n<li>With the extension off, nothing is printed.<\/li>\n\n\n<li>Export &amp; Import does not carry this code. Paste it again on a new site.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The Custom Code extension prints code you paste into the header or footer of your site, without editing a theme file. Use it for Google Analytics, Google Tag Manager, Search Console verification, a pixel or a live chat. See it on the Custom Code demo page. The chat bubble on that page was added with [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[31],"doc_tag":[],"class_list":["post-5667","docs","type-docs","status-publish","hentry","doc_category-pro-extensions"],"year_month":"2026-11","word_count":430,"total_views":"9","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"name":"Sojib","author_nicename":"shapekode-admin","author_url":"https:\/\/shapekode.com\/product\/shapeblock\/author\/shapekode-admin\/"},"doc_category_info":[{"term_name":"Pro Extensions","term_url":"https:\/\/shapekode.com\/product\/shapeblock\/docs-category\/pro-extensions\/"}],"doc_tag_info":[],"_links":{"self":[{"href":"https:\/\/shapekode.com\/product\/shapeblock\/wp-json\/wp\/v2\/docs\/5667","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shapekode.com\/product\/shapeblock\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/shapekode.com\/product\/shapeblock\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/shapekode.com\/product\/shapeblock\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shapekode.com\/product\/shapeblock\/wp-json\/wp\/v2\/comments?post=5667"}],"version-history":[{"count":3,"href":"https:\/\/shapekode.com\/product\/shapeblock\/wp-json\/wp\/v2\/docs\/5667\/revisions"}],"predecessor-version":[{"id":5728,"href":"https:\/\/shapekode.com\/product\/shapeblock\/wp-json\/wp\/v2\/docs\/5667\/revisions\/5728"}],"wp:attachment":[{"href":"https:\/\/shapekode.com\/product\/shapeblock\/wp-json\/wp\/v2\/media?parent=5667"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/shapekode.com\/product\/shapeblock\/wp-json\/wp\/v2\/doc_category?post=5667"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/shapekode.com\/product\/shapeblock\/wp-json\/wp\/v2\/doc_tag?post=5667"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}