How to Properly Add Header and Footer Code in WordPress Site

Are you finding it difficult on How to Properly Add Header and Footer Code in WordPress Site or adding some activation code snippets to the <header> or <footer> section of your blog or WordPress site?

These codes could come from various web services or internet entities like Google AdSense, Google Search Console or Webmaster Tool, Google Analytics, Facebook Pixels, WordPress Plugins and more to be integrated or added into the header and footer section of your WordPress site.

In this article, we will show you two possible resort or methods on how to easily Add Header and Footer Code in WordPress site.

Two Methods to Add Header and Footer Code in WordPress Site

  • The first option is to manually or directly add header and footer code in WordPress site by editing your theme file called header.php and footer.php files
  • The Second option is detailed on how to safely add the code using a WordPress Plugin called Insert Headers and Footers WordPress Plugin (The Best Recommended Method-Easy and Safe)

The mentioned first option is not beginner or starter friendly because it requires you to manually or directly add the code by editing your theme file called header.php and footer.php.

Another downside of making use of this first method is that on updating your WordPress theme, your code will be removed during the update and will require you to add it again.

That is the right reason why we specified that The Best Recommended Method-Easy and Safe is the second option, using Insert Headers and Footers WordPress Plugin.

Benefits of using the Insert Headers and Footers WordPress plugin:

1. Insert Headers and Footers WordPress Plugin is Faster, Easy and Safely Organized.

2. Insert Headers and Footers WordPress Plugin Prevents Errors which may occur when you have to edit your WordPress Site theme files manually.

3. Insert Headers and Footers WordPress Plugin remember your actions or changes made with it and retain the code after Upgrading or Switching Your WordPress Theme.

4. Insert Headers and Footers WordPress Plugin Avoid unintentionally placing snippets code in the wrong places of your WordPress Blog or Website.

How to Properly Add Header and Footer Code in WordPress Site

Method 1: How to Add Header and Footer Code in WordPress Site Manually

How to Add Header and Footer Code in WordPress Site Manually by editing your theme file called header.php and footer.php files.

  • Login to your WordPress Dashboard
  • From the left side of your WordPress Dashboard Hover on Appearance »
  • Then Click Theme Editor »
  • Click the Theme Header (header.php)
  • Paste the code between <head> and </head> tag. I wouldn’t recommend pasting it within the middle of any code already there. Therefore I pasted it simply after the opening <head> tag.
  • Then Click Update File as shown below
How to Properly Add Header and Footer Code in WordPress Site By Editing Theme File-Header.php
How to Properly Add Header and Footer Code in WordPress Site By Editing Theme File-Header.php

Method 2: How to Add Header and Footer Code in WordPress Site Using a WordPress Plugin

How to Add Header and Footer Code in WordPress Site Using Insert Headers and Footers WordPress Plugin

  • Go to your Plugin page and Install and activate the Insert Headers and Footers WordPress Plugin as described below
  • Plugins »
  • Add New »
  • Type Insert Headers and Footers »
  • Install »
  • Activate.
How to Properly Add Header and Footer Code in WordPress Site using Insert Header and Footers WordPress Plugin
How to Properly Add Header and Footer Code in WordPress Site using Insert Header and Footers WordPress Plugin

For more details, refer to our step by step guide on How to Install WordPress Plugins.

  • Once you get the Insert Headers and Footers WordPress Plugin activated,
  • Go to Settings »
  • Click Insert Headers and Footers from your WordPress Dashboard or Admin Panel.
  • Then you`ll see two empty boxes or spaces provided for adding code to the header and footer section of your WordPress Site.

Simply paste the code within the header section of the plugin which is the first empty box. As soon as you are done, remember to Click the Save Button to keep your changes.

The Insert Headers and Footers WordPress Plugin will now automatically load the code in the respective and recommended places or locations on your WordPress site.

You can always edit and remove any code by deleting the desired code that you don’t want to keep and hit the Save Button.

Final Thought

You need to keep the plugin always installed and activated no matter what you do on your site. Deactivating the Insert Headers and Footers WordPress Plugin will stop adding all custom code to your WordPress site.

And if by any chance you deactivate or remove the plugin, the code will remain securely stored in your WordPress site database. All you have to do is just reinstall or reactivate the Insert Headers and Footers WordPress Plugin, and the code will start functioning properly again.

Should in case the code doesn`t show as recommended or desired, you may simply have to clear your WordPress cache after saving the new changes made so that the code can then properly appears and function correctly on the front-end of your website.

We hope this article was useful and helped you to learn how to add header and footer code in WordPress easily using Insert Headers and Footers WordPress Plugin.

Recommended Articles

How to Add Your WordPress Site to Google Search Console(GSC)

9 Best SEO WordPress Plugins and Tools to Grow Your Website Traffic!

If you liked this article, then please leave a comment. You can also find us on PinterestFacebook, and Twitter.

LEAVE A REPLY

Please enter your comment!
Please enter your name here