{"id":10573,"date":"2022-12-12T14:49:00","date_gmt":"2022-12-12T05:49:00","guid":{"rendered":"https:\/\/hanami-web.tokyo.jp\/blog\/?p=10573"},"modified":"2022-12-09T15:22:29","modified_gmt":"2022-12-09T06:22:29","slug":"header-insert-plugin","status":"publish","type":"post","link":"https:\/\/hanami-web.tokyo.jp\/blog\/en\/website-running\/wordpress\/header-insert-plugin\/","title":{"rendered":"How to Add Code to the Head of Your WordPress Site"},"content":{"rendered":"<p>Advertisements and other WordPress site There may be times when you need to embed code in your site. Here&#039;s how to do it using a plugin without modifying the php file!<\/p>\n\n\n\n<p>There are several types of plugins that allow you to embed code in the head, so we&#039;ll introduce the features of each one!<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 ez-toc-wrap-center counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">table of contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #000000;color:#000000\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #000000;color:#000000\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewbox=\"0 0 24 24\" version=\"1.2\" baseprofile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/hanami-web.tokyo.jp\/blog\/en\/website-running\/wordpress\/header-insert-plugin\/#insert_headers_footers%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3\" >Insert Headers &amp; Footers Plugin<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/hanami-web.tokyo.jp\/blog\/en\/website-running\/wordpress\/header-insert-plugin\/#insert_headers_footers%e3%81%ae%e7%ae%a1%e7%90%86%e7%94%bb%e9%9d%a2\" >Insert Headers &amp; Footers administration screen<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/hanami-web.tokyo.jp\/blog\/en\/website-running\/wordpress\/header-insert-plugin\/#header_footer_code_manager\" >Header Footer Code Manager<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/hanami-web.tokyo.jp\/blog\/en\/website-running\/wordpress\/header-insert-plugin\/#header_footer_code_manager%e3%81%ae%e7%ae%a1%e7%90%86%e7%94%bb%e9%9d%a2\" >Header Footer Code Manager administration screen<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/hanami-web.tokyo.jp\/blog\/en\/website-running\/wordpress\/header-insert-plugin\/#functionphp%e3%81%ab%e3%82%b3%e3%83%bc%e3%83%89%e3%82%92%e8%bf%bd%e5%8a%a0%e3%81%a7%e3%81%8d%e3%82%8bcode_snippets%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3\" >Code Snippets plugin that allows you to add code to function.php<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/hanami-web.tokyo.jp\/blog\/en\/website-running\/wordpress\/header-insert-plugin\/#google%e3%82%bf%e3%82%b0%e3%83%9e%e3%83%8d%e3%83%bc%e3%82%b8%e3%83%a3%e3%83%bc%e3%82%92%e4%bd%bf%e3%81%88%e3%81%b0%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%e4%b8%8d%e8%a6%81\" >No plugin needed with Google Tag Manager<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"insert_headers_footers%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3\"><\/span>Insert Headers &amp; Footers Plugin<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>First up is the WPCode \u2013 Insert Headers &amp; Footers plugin.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"333\" src=\"https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/image-30-1024x333.png\" alt=\"\" class=\"wp-image-10574\" srcset=\"https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/image-30-1024x333.png 1024w, https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/image-30-300x98.png 300w, https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/image-30-768x250.png 768w, https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/image-30-1536x500.png 1536w, https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/image-30.png 1668w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"insert_headers_footers%e3%81%ae%e7%ae%a1%e7%90%86%e7%94%bb%e9%9d%a2\"><\/span>Insert Headers &amp; Footers administration screen<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>When you click on the header &amp; Footer item, it will look like this. This is a system that allows you to add code to the header without having to modify header.php.<\/p>\n\n\n\n<section class=\"wp-block-uagb-section uagb-section__wrap uagb-section__background-none uagb-block-d922b3d3\"><div class=\"uagb-section__overlay\"><\/div><div class=\"uagb-section__inner-wrap\">\n<p>This cannot be reflected on individual pages and is a bulk setting.<\/p>\n<\/div><\/section>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"495\" src=\"https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/image-31-1024x495.png\" alt=\"\" class=\"wp-image-10575\" srcset=\"https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/image-31-1024x495.png 1024w, https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/image-31-300x145.png 300w, https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/image-31-768x371.png 768w, https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/image-31-1536x743.png 1536w, https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/image-31.png 1657w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"header_footer_code_manager\"><\/span>Header Footer Code Manager<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Next, I&#039;d like to introduce Header Footer Code Manager.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"323\" src=\"https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/image-32-1024x323.png\" alt=\"\" class=\"wp-image-10576\" srcset=\"https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/image-32-1024x323.png 1024w, https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/image-32-300x95.png 300w, https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/image-32-768x242.png 768w, https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/image-32-1536x484.png 1536w, https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/image-32.png 1638w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"header_footer_code_manager%e3%81%ae%e7%ae%a1%e7%90%86%e7%94%bb%e9%9d%a2\"><\/span>Header Footer Code Manager administration screen<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>You can add codes one by one. You can also add them to specific pages, so the Header Footer Code Manager plugin can be used to add ad tags only to conversion pages.<\/p>\n\n\n\n<p>It&#039;s easy to use as you can simply disable the code when it&#039;s no longer needed.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"917\" height=\"731\" src=\"https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/image-33.png\" alt=\"\" class=\"wp-image-10578\" srcset=\"https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/image-33.png 917w, https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/image-33-300x239.png 300w, https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/image-33-768x612.png 768w\" sizes=\"(max-width: 917px) 100vw, 917px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"functionphp%e3%81%ab%e3%82%b3%e3%83%bc%e3%83%89%e3%82%92%e8%bf%bd%e5%8a%a0%e3%81%a7%e3%81%8d%e3%82%8bcode_snippets%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3\"><\/span>Code Snippets plugin that allows you to add code to function.php<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Although it is not the head, there may be cases in WordPress where you need to add code to function.php. In that case, we recommend the Code Snippets plugin.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You can add it without modifying the existing function.php.<\/li>\n\n\n\n<li>You can add items one by one, so you can stop them immediately when they are no longer needed.<\/li>\n\n\n\n<li>Incorrect codes will not be saved.<\/li>\n<\/ul>\n\n\n\n<p>There are some advantages to using Code Snippets. I have written about it in another article, so please check it out!<br>\u2192<a href=\"https:\/\/hanami-web.tokyo.jp\/blog\/en\/member\/php-customize\/\" title=\"\">How to edit the php files of your theme or plugin<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"google%e3%82%bf%e3%82%b0%e3%83%9e%e3%83%8d%e3%83%bc%e3%82%b8%e3%83%a3%e3%83%bc%e3%82%92%e4%bd%bf%e3%81%88%e3%81%b0%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%e4%b8%8d%e8%a6%81\"><\/span>No plugin needed with Google Tag Manager<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In fact, if you use Google Tag Manager You can add the code within the URL, so no operations are required on the WordPress site side. You can also add the code to a specific page by specifying it.<\/p>\n\n\n\n<p>We also connect to the Google Tag Manager, so when adding ad tags, we run them all through the Tag Manager! For more information on the Tag Manager, please see our page on how to analyze and improve your WordPress site!<\/p>\n\n\n<div class=\"sc\"><a href=\"https:\/\/hanami-web.tokyo.jp\/blog\/en\/wordpress-analytics\/\" title=\"Summary of WordPress site analysis and improvement methods\" target=\"_blank\">\r\n\t<p class=\"sc-txt01\">We introduce how to analyze and improve your WordPress site.<\/p>\r\n\t<p class=\"sc-txt02\">Summary of site analysis and improvement methods \u2192<\/p>\r\n<\/a><\/div>","protected":false},"excerpt":{"rendered":"<p>\u5e83\u544a\u306a\u3069\u3067WordPress\u30b5\u30a4\u30c8\u306e&lt;head&gt;\u306b\u30b3\u30fc\u30c9\u3092\u57cb\u3081\u8fbc\u307e\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u5834\u5408\u304c\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u3002php\u30d5\u30a1\u30a4\u30eb\u3092\u4fee\u6b63\u305b\u305a\u306b\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u3063\u305f\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\uff01 \u6570\u7a2e\u985ehead\u306b\u30b3\u30fc\u30c9\u3092\u57cb\u3081\u8fbc\u3081\u308b\u30d7\u30e9 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":10580,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"content-type":"","_uag_custom_page_level_css":"","footnotes":""},"categories":[16],"tags":[],"class_list":["post-10573","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress"],"blocksy_meta":[],"aioseo_notices":[],"uagb_featured_image_src":{"full":["https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/thumnail-1-2.png",720,540,false],"thumbnail":["https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/thumnail-1-2-150x150.png",150,150,true],"medium":["https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/thumnail-1-2-300x225.png",300,225,true],"medium_large":["https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/thumnail-1-2.png",720,540,false],"large":["https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/thumnail-1-2.png",720,540,false],"1536x1536":["https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/thumnail-1-2.png",720,540,false],"2048x2048":["https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/thumnail-1-2.png",720,540,false],"trp-custom-language-flag":["https:\/\/hanami-web.tokyo.jp\/blog\/wp-content\/uploads\/2022\/11\/thumnail-1-2.png",16,12,false]},"uagb_author_info":{"display_name":"\u682a\u5f0f\u4f1a\u793eHanamiWEB \u4ee3\u8868\u53d6\u7de0\u5f79 \u677e\u6d66\u307f\u3055","author_link":"https:\/\/hanami-web.tokyo.jp\/blog\/en\/author\/hanami\/"},"uagb_comment_info":0,"uagb_excerpt":"\u5e83\u544a\u306a\u3069\u3067WordPress\u30b5\u30a4\u30c8\u306e&lt;head&gt;\u306b\u30b3\u30fc\u30c9\u3092\u57cb\u3081\u8fbc\u307e\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u5834\u5408\u304c\u3042\u308b\u3068\u601d\u3044\u307e&hellip;","brizy_media":[],"_links":{"self":[{"href":"https:\/\/hanami-web.tokyo.jp\/blog\/en\/wp-json\/wp\/v2\/posts\/10573","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hanami-web.tokyo.jp\/blog\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hanami-web.tokyo.jp\/blog\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hanami-web.tokyo.jp\/blog\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hanami-web.tokyo.jp\/blog\/en\/wp-json\/wp\/v2\/comments?post=10573"}],"version-history":[{"count":0,"href":"https:\/\/hanami-web.tokyo.jp\/blog\/en\/wp-json\/wp\/v2\/posts\/10573\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hanami-web.tokyo.jp\/blog\/en\/wp-json\/wp\/v2\/media\/10580"}],"wp:attachment":[{"href":"https:\/\/hanami-web.tokyo.jp\/blog\/en\/wp-json\/wp\/v2\/media?parent=10573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hanami-web.tokyo.jp\/blog\/en\/wp-json\/wp\/v2\/categories?post=10573"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hanami-web.tokyo.jp\/blog\/en\/wp-json\/wp\/v2\/tags?post=10573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}