How to insert code into WordPress Header and Footer

To insert code (Google Analytics, Google Tag, Google Webmasters, Livechat,….) into WordPress Header or Footer, you can use plugin or manual inserts.

Method 1. Insert code into WordPress Header and Footer with Plugin

Step 1. Install and Activate Insert Headers and Footers

wpcodeless-insert-headers-and-footers1-min

wpcodeless-insert-headers-and-footers2-min

Step 2. Go to Settings > Insert Headers and Footers

wpcodeless-insert-headers-and-footers3-min

Step 3. Insert code

To insert code into Header (or in <head> or above </head> tag), just paste your code into Scripts in Header.

To insert code into Footer (or above </body> tag), just paste your code into Scripts in Footers

and click on Save

wpcodeless-insert-headers-and-footers4-min

Method 2. Manual Insert

Step 1. Go to Appearance > Editor

wpcodeless-appearance-editor-1-min

Step 2. Find Header.php and Footer.php

Step 3. Insert code

To insert code into WordPress Header, just paste your code above </head> in Header.php

wpcodeless-header-footer-php2-min

To insert code into WordPress Footer, just paste your code above </body> in Footer.php

wpcodeless-header-footer-php3-min

and click on Update File

Share this post:

Leave a Comment