AWPGuide

Beginner's Guide For WordPress

  • Blog
    • Monetization
    • Reviews
    • Showcase
    • WordPress Guides
    • ScanWP
  • Start Here
  • Deals
  • Blueprint

Last Updated On October 13, 2018 By Christina

AWPGuide » WordPress Guides » How To Add Code On WordPress Theme Header

How To Add Code On WordPress Theme Header

How To Add Code On WordPress Theme Header

Do you want to add code on WordPress header? In this post, we will show you the right method to do it. Last day, one of our users asked about this for adding Google Analytics code and for adding Google AdSense code. You don’t need to be techy for doing it. So here’s the post for beginners who need to add code on WordPress theme header.

Add Code On WordPress Theme Header

Typically there are 2 simple methods available for doing it. Both are beginner’s friendly. The first one is by editing the theme files and the second one is by using a dedicated plugin. We are going to cover them both here.

Theme Editing Method

There will be a file in the theme called header.php. All you need to do is, edit the header.php and add your code. First of all, log in to your WordPress dashboard and go to the theme editor.

Add Code On WordPress Theme Header

From the right side, choose the header.php file. If you are using any child theme on your blog, download the header file from the parent theme, upload it on your child theme’s folder. You can use the cPanel file manager or an FTP client for doing it.

twenty seventeen theme file header

Add the code just before the </head> tag. Simply update the file when you are done.

adding header code just below head tag

You are done! If you change your theme recently, this method will won’t work. Also, use a child theme while using this method. Or, try the next method.

Plugin Method

Go to add new plugins on your dashboard and install Insert Headers and Footers plugin.

install plugin insert headers and footers

After installing it, activate the plugin.

insert headers and footers activate plugin

You can find the plugin settings under the settings menu.

insert headers and footers plugin settings

Add the code that you need in the head section and save the changes.

save code that added in insert headers and footers plugin

Simple isn’t it? You can view the page source for confirmation.

No matter if you are on parent theme or changed themes. This plugin will add the code just before the </head> tag of every theme.

We hope you found this post helpful and enjoyed the post. If you did, please consider sharing this post with your friends and fellow bloggers. For more related posts, you need to check out our blog section.

Full Disclosure This post may contain affiliate links, meaning that if you click on one of the links and purchase an item, we may receive a commission (at no additional cost to you). All opinions are our own and we do not accept payments for positive reviews.

About Christina

Christina is the lead editor in AWPGuide.
She will mainly write about WordPress tutorials, product reviews, monetization tricks, and related stuff.
Christina is led by Sreehari.

Leave a Reply Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let us have a personal and meaningful conversation.

Learn WordPress Now!

Never miss our updates! We are adding fresh contents daily!
Join our newsletter and learn WordPress now!

The Best of AWPGuide

We have the best guides here! Some of them are below!

Beginner's Guides

  • 1
    Media.net Review (and RPM Optimization Guide)
  • 2
    Grammarly Review: Free Proofreading Tool
  • 3
    Why You Need To Build an Email List?
  • 4
    How To Start a Free Blog on CloudAccess.net
  • 5
    Aspire pro Documentation and Setup
  • 6
    WP Engine Affiliate Program Review
  • 7
    How To Add Coupon Section In WordPress

Theme Reviews

  • 1
    Jupiter X WordPress Theme Review
  • 2
    Newsmag WordPress Theme Review
40% DISCOUNT
AWPGuide
LiveChat Coupon

LiveChat Coupon

Looking for LiveChat Inc coupon? In this post, we are going to share one for you. This coupon will help you to get 40% off on the discount. LiveChat is the best tool for live chatting and help desk services!
Get This Deal

ABOUT AWPGUIDE

Finally we have launched AWPGuide blog! At this time of writing, we know, there are so many blogs are providing blogging and money making tips and tricks.

We are not like them! In AWPGuide, we will cover WordPress, blogging, SEO, make money online guides and will teach you how to start, maintain and monetize a WordPress blog.

All these guides will be 100% free and always it will be. We are not running a typical membership website for making money. Also, AWPGuide is free from display advertising, pop-up ads and URL shortner!

For more, feel free to check out our about page.

SITE LINKS

About Us

Advertise Here!

Contact Us

Free Blog Setup

Terms of Service

Write For Us!

Privacy Policy

Deals

OptinMonster Coupon

MyThemeShop Coupon

WPForms Coupon

Bluehost Coupon

CSS Hero Coupon

Social Warfare Coupon

REVIEWS

Genesis Framework

WP Coupons

WP Review Pro

Slider Revolution

Newsmag

Jupiter X

MonsterInsights

© 2023 · AWPGuide LLC