How to add the google adsense verification code to your site!
Published on March 14, 2017
Published on Wealthy Affiliate — a platform for building real online businesses with modern training and AI.
Hello and thank you for checking out my latest post!
First off we need to get some terminology straight when it comes to the adsense codes. When you first signup to adsense they say that you need to put some code in your page. In the head section after the <head> and before the </head> tag. This code is a one time thing that will be used to tell google adsense that the site is yours and to register the site with adsense.
The verification code is a one time thing. It IS NOT the ad code that you will use later on and it looks something like this...
GOOGLE ADSENSE VERIFICATION CODE
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-xxxxxxxxxxxxxxxxxx",
enable_page_level_ads: true
});
</script>
This is the code that needs to be inserted between the <head> and </head> tags of your site. There are about 2 different ways of doing this that I will discuss as I think these are the easiest ways. I have instructed people on how to actually manually alter their header file using FTP but that may have been a bit hard for some people to understand. The ways described below are a lot easier.
Method #1
Go to your wordpress dashboard and click appearance->editor, this will open a page that may look like this.

This area allows you to modify the theme files of your wordpress theme. I always recommend making a child of your theme and using that so that when you modify the files, they don't get wiped out by an update but that is for later! :)
Go to your adsense page, select all of the verification code, right click and select copy. Go back to your wordpress editor page
Ready to put this into action?
Start your free journey today — no credit card required.
Click on the header.php file under template in the right hand menu. It may be called Theme Header (Header.php). Once that file is opened in the editor or center of the screen, locate the <head> tag. Click your mouse AFTER the > character of <head> and click enter. This will start a new line under the <head> tag. Either right click and click paste or hit ctl-v to paste the code here.
Your header.php should now look similar to this...

This method is probably one of the best if you don't like plugins. The downside to this method is that if you alter your themes files without making a child theme, if you ever update your theme with a newer version, all your changes will be lost.
Method #2
This method will use the plugin "Insert Headers and Footers", this plugin is pretty popular, has a 4+ rating and over 200k installs.
Go to your wordpress dashboard and click plugins. In the upper area of the screen click the ADD NEW button. In the right hand side is a search box, type "Insert Headers and Footers" in the box and the plugin should show up. Make sure its the one with over 200k installs.

Once you find it, click download, then click activate.
Now go to the left hand menu and go to settings->Insert Headers and Footers. This will bring up a screen showing 2 text boxes. The top box is for your header, the bottom box is for your footer.
Go to your adsense page, select all of the verification code, right click and select copy. Go back to your wordpress page, click in the top text box area, right click and select paste or CTL-V to paste the code in the box

You have now added the adsense verification code to your website. Now you need to go to adsense and tell them that you have added the code. It may take a few hours to a few days for them to see it. Once they do, you will then get access to creating your ad blocks which will generate totally different code that you will put in widgets of your wordpress.
I see this question getting asked almost daily so I figured I would help out and give people a place to go to get some help with this.
If you have any questions or need help, please leave a comment below!
Thank you!
:)
Share this insight
This conversation is happening inside the community.
Join free to continue it.The Internet Changed. Now It Is Time to Build Differently.
If this article resonated, the next step is learning how to apply it. Inside Wealthy Affiliate, we break this down into practical steps you can use to build a real online business.
No credit card. Instant access.