ブログやサイトの全てのページのヘッダーやフッターにコードを挿入するのは、プラグインで簡単に実現できます。
ここでは「Head, Footer and Post Injections」プラグインを紹介いたします。
Head, Footer and Post Injectionsプラグインのインストール
(1)WordPressのダッシュボードから「プラグイン」をクリックし、「新規プラグインを追加」をクリックします。
![](https://i0.wp.com/surfclub.site/wp-content/uploads/2024/02/head-1-01.png?resize=458%2C243&ssl=1)
(2)①に「Head, Footer and Post Injections」を入力すると、「Head, Footer and Post Injections」プラグインが表示されるので②の「今すぐインストール」をクリックします。
![](https://i0.wp.com/surfclub.site/wp-content/uploads/2024/02/head-1-02.png?resize=500%2C162&ssl=1)
(3)インストール完了後、「有効化」をクリックします。
![](https://i0.wp.com/surfclub.site/wp-content/uploads/2024/02/head-1-03.png?resize=500%2C196&ssl=1)
コードを挿入
(1)ダッシュボードから「設定」をクリックし、「Head and Footer」をクリックします。
![](https://i0.wp.com/surfclub.site/wp-content/uploads/2024/02/head-1-04.png?resize=453%2C340&ssl=1)
(2)「<HEAD> PAGE SECTION INJECTION」はすべてのページのヘッダ内に入れる箇所です。
①にコードを入力し、②「save」をクリックします。
![](https://i0.wp.com/surfclub.site/wp-content/uploads/2024/02/head-1-05.png?resize=500%2C315&ssl=1)
(3)「AFTER THE <BODY> TAG」はBODY内、「BEFORE THE </BODY> CLOSING TAG (FOOTER)」はフッター内に入力する箇所です。