WEBFI-WordPress-How to Add Header and Footer Code in WordPress (the Easy Way)

Are you looking to add header or footer code to your WordPress website? One method would be to go into your theme’s files to edit the PHP yourself which can be daunting for new users. In this video, we will show you how to insert header and footer code in WordPress the easy way.


►Written Tutorial – How to Add Header and Footer Code in WordPress (the Easy Way)
►MonsterInsights Promo Code WPBVIP

–Top Resources–

Use Promo Code WPBVIP

►Best WordPress Contact Form Plugin
►Best WordPress Analytics Plugin
►Best Lead Generation Plugin
►Best WordPress SEO Plugin
►Best Landing Page Builder for WordPress
►Best WordPress Giveaway Plugin

–Related Videos–
►WordPress Tutorial – How to Make a WordPress Website for Beginners
►WordPress Gutenberg Tutorial: How to Easily Work With the Block Editor
►What is SEO and How Does it Work?
►How to Install a WordPress Theme

For this video we will be using the Insert Headers and Footers plugin that WPBeginner maintains found here:

With the plugin installed and active, you can go under your Settings, Insert Headers and footers section in your admin area to see the two text areas where you can insert code. The top section is for code that should be in the head of your site while the bottom is for placing code above the end /body tag.

The plugin allows you to make this change and if you update your theme the code modification will stay rather than being overwritten.

Without the plugin, you would manually need to go under Appearance, Theme Editor and choose the files that you want to add the code to. When adding code using this method you will lose any modifications if you update your theme.
If you liked this video, then please Like and consider subscribing to our channel here for more WordPress videos.

Check us out on Facebook

Follow us on Twitter

Check out our website for more WordPress Tutorials
#WordPress #WordPressTutorial #WPBeginner



  • vivek kushwaha on June 2, 2020

    Hi guide me please…if i dont see my copyright section on my page…how i can get..

  • Madhusmita Choudhury on June 26, 2020

    Hi could you please help, how to add any header and footer using Code Snippets plugin?

  • Sushrut Bhattacharya on July 19, 2020

    Much easier than other plugins…I needed to input an WebPush ad code for my entire site & this did the trick…Thank You…

  • Spencer BCE on July 25, 2020

    I noticed that plugin was developmented by you. Amazing! Thanks for the tutorial….

  • crispy on August 22, 2020

    Can I use the plugin for multiple HTML codes to configure google structured data markup? I am trying to upload a few pages with snippets for my sites. Thanks in advance for your replay.

  • Sanjeev Kumar on August 30, 2020

    excellent plugin.

  • Krail Mitchell on October 5, 2020

    How to add more html code to the header and you do not want to remove the one that you have there? I need to put it in the same palce

  • Geronimo 99 on October 14, 2020

    I installed the plugin and went to add header code, then got this error screen from Wordfence:
    "A potentially unsafe operation has been detected in your request to this site

    Your access to this service has been limited. (HTTP response code 403)

    If you think you have been blocked in error, contact the owner of this site for assistance.

    If you are an administrator and you are certain this is a false positive, you can automatically whitelist this request and repeat the same action.

    Block Technical Data

    Block Reason: A potentially unsafe operation has been detected in your request to this site"

    I was asked if I want to proceed, and decided not to.

  • Parth Joshi on October 29, 2020

    Saves me a lot of time! Thanks!

  • Dr Sky Consultancy on November 23, 2020

    Can I put more than one code like Google tracking and Pinterest tracking under same header section?

  • Graded Card Investor on December 17, 2020


  • Urooj Khan on December 20, 2020

    I am using TS Charity theme. I have added a new footer menu and placed it in the footer using code. It appears on the left bottom side as bullets. I want them in a line as a footer menu. where shall I place the CSS code?

  • The Hygg on December 30, 2020

    Hi, I really like your tutorials! Great work!
    I have used this plugin for Google Tag Manager to keep track of my website.
    Now I also want to add Google Adsense. How do I implement that?
    Can I just add the Google Adsense code to the Header scripts? Before or after Google Tag Manager? Or does that not matter?
    Thanks for your reply.

  • Carly Johnson on January 11, 2021

    I’m glad there’s videos like this for the moments I’m in ugly tears ready to throw my computer. Thank you so much for y’all’s help!

  • Harsha Jain on January 15, 2021

    Hello sir,, plz help me i need to convert my html template in word press project dynamically. Plz suggest me how I add header, footer and insert image dynamically

  • Gary Hamm on March 8, 2021

    Excellent Example!

  • Ashley Brenda on March 16, 2021

    In this case, the code will be working for the entire website right? What if I need to add the code on a specific page?

  • Sheikh Somrat on May 30, 2021

    I inserted and It's working. But the Problem is code Is Showing the Website Front End Homepage Header section. How II can Remove it?? Pls Help

  • Bassinet Technologies on June 22, 2021

    Since we need to add facebook pixel tags to all pages, does this plugin take care of that? Since we will be installing it only once in to the insert headers and footers plugin header area?

  • الكلمة الطيبة on June 22, 2021

    thanks , good work

    Can I add more than one code inside the header only, for example, to link the Facebook pixel and also to link the Google Analytics code?

  • Enbege on July 5, 2021

    I installed that plugin, but I can't insert something in the header. For body and footer it's not a problem, but if I want to put it in header nothing happens. Can someone help me please? I installed the plugin on 3 different websites and no one worked.

  • Sussie N. on August 22, 2021

    Hi there can i add a facebook pixel in this plugin ?


    How can we add script only on a specific page footer not on all pages

  • Tech Lover on August 26, 2021

    if remove the insert header and footer plugin after inserted code, will it remove the code also???

  • Viktar Ramanienka on October 11, 2021

    Hi! If I need to add js code on product pages only can I add something like <?php if ( is_product() ) { ?><script>…</script><? } ?> Will it work with your plugin?

  • Sidhant ㋡ on October 18, 2021

    What will happen if I update the theme ?

  • Heidi Hanson on October 18, 2021

    Does this work for a specific page? You left that out of the video.

  • Remy Ayo on November 26, 2021

    looks like i can't install this plugin without paying $300 to upgrade to Business plan 🙁

  • Jose Rafael Hill Ruiz on December 6, 2021

    Awesome! helped me alot with an affiliate marketing site! thanks!

WhatsApp us
Live Chat

Office hours operation Mon-Sun 8:00 am ET – 4:00 pm ET

To start your Premium WP or Cpanel service, use our domain search engine, if the domain you want is available, contact us by Whats app to activate your project.

The easiest, fastest, and most secure way to communicate with us.
Please enter your domain.
Please verify that you are not a robot.

Terms Privacy