When you get approved by Google Adsense, they will give you a snippet of HTML code to paste into the header of your website. You have to past it between the <head> and </head> tags.

As somebody who is not really tech savvy, I really struggled to add the Google Adsense HTML code to my website, so I will share what I did.

My first port of call was to search the Wealthy Affiliate platform and training modules, but no luck. I could find several posts on Google Adsense in general, but nothing to show me where in the header I had to put this HTML code.

I then did a Google search, and with Wordpress information, I set off to add the code.

The theme I use is Generate Press, so your theme might look different, but I am sure the principle is the same.

So click on Appearance, then at the bottom click on Theme Editor.

Next, on the right hand side, scroll down till you find header.php, and click on that.

In my theme, <head> was line 14, and </head> line 18, with other code between. I inserted it right after <head>. So in this image you can see the code in row 15.

Remember to click on Update File at the bottom.

Next step was to tell Google Adsense that I have done it. I was very nervous that I might have destroyed my site or something silly, but this is what happened next.



Join the Discussion
Write something…
Recent messages
Happy2020 Premium
Leslie, Have you found the way you did it to be a problem? I don't know how to add it like a plugin
Reply
DianeScorpio Premium
Hi - this is far too early for you to be applying to AdSense.

The first piece of code they send simply allows them to check your website to ensure you have lots of original content, at least 15 articles and that you are attracting traffic.

Your website has not even been found by Google yet, so it is not in its search engine.
Reply
TheAbiePPlus Premium Plus
You can use the Ad Inserter plugin, as you do not want to edit your themes files directly as you will lose your changes when the theme updates or if you change your theme.
Reply
MelWaller Premium
Thanks for this info, Abie.

Mel
Reply
feigner Premium
Lesley don't add the code to your theme .....
it will be gone the next time your theme needs an update for security or compatability....
add it using a plugin like ad inserter or headers and footers
or make a child theme...
sorry to be the bearer of bad news,,,,
but i would rather you keep the adsense that as with others .. .get a warning that the code cannot be found.......
plugins only slow your site down if they are badly coded....
phil
Reply
LCowley1 Premium
Thanks for this Phil,
I'll have a look at that.
Liné
Reply
feigner Premium
i would say i do have training on using the ad inserter plugin, but didn't put the above reply for that...it is true
i know members who has stopped getting analysis data due to google checking their site for the verification code and it was missing...
as i said above the same for people with adsense....
for ref the training is
Reply
LCowley1 Premium
Thanks, I'll have a look Phil
Line
Reply
Top