How to add AdSense code in your WordPress blog

Disclosure: This post may contain affiliate links. This is how we stay funded and these commissions are what keep our site going. Please support us by purchasing through our affiliate links.

When it comes to blog monetization, Ads and affiliate marketing are the easiest way to get started.

Though not every blog niche will earn the same amount, there are some niches where you can earn a lot more with ads.

So, to get started with ads, you must first add your AdSense code to your WordPress blog. Now, you must be wondering how you can do it, right?

There are two ways to add AdSense code to your WordPress blog. One is by adding your code manually which you will paste in your theme header, the other way is to use a plugin. In this post, I will show you all the steps in a very simple way.

Once you have added your code, you will automatically start to make money. So let me show you how you can do it.

A little reminder: Google Adsense is not the only platform that allows you to earn money through display ads. There are other ad networks where you can earn a lot more than Google Adsense. Do check it out.

Related article: Best ad networks for new bloggers

1. How to create Google Adsense Account

First, you will need to have a Gmail account to be able to create an Adsense account.

If you already have a Gmail account, then it will be pretty easy. 

Head over to Google Adsense and create your account.

Fill in the required information like your Url and email address and click on save and continue.

Now, you will be directed to Google Adsense’s terms and conditions where you will have to read and click on accept the agreement (Bottom of your screen).

Now click on continue to AdSense.

2. How to Add Adsense code to your WordPress blog manually

Next, you will be directed to the Google AdSense dashboard, where you will get your code.

Copy the code and head over to your WordPress Dashboard.

Note: Only copy the code, don’t click on done. You will have to paste the code then come back to Google Adsense to confirm that you have pasted the code.

In your WordPress dashboard, click on “Appearance”, “Theme editor” then choose Theme Header in the theme files section.

Paste the code just under the Head tag.

Now press on update and head over to your Google AdSense dashboard.

Select the “I have pasted the code” checkbox and click done. You will get a pop-up that will tell you that approval is in progress. Click on “Got it”.

Pro Tip: Recently Google Adsense has announced auto ads, which means that you just paste a single code and your blog will start to show ads. I will show you how to do it later.

3. How to add Adsense to your WordPress blog code using a Plugin

The best plugin I know is the Ad Inserter plugin. It has both free and paid versions. You don’t need to buy the premium version as the free version is enough to add at least 16 ads to your blog.

Download the plugin from WordPress.Org, Install and activate the plugin.

Now head over to your WordPress dashboard, under “Setting” click on “Add “Inserter”.

Paste your code in the grey box.

You will see that you will get a lot of options under the grey box. Here you can choose to show the ads on specific pages and you can even choose where you will place the ads.

Once completed save the setting (Save settings 1-16).

The awesome thing about Ad Inserter is that you can create individual ad formats and place them wherever you want.

Now that you know both ways of adding your AdSense code to your WordPress blog, let’s see how you can create individual ad units and add them to your blog.

4. How to add AdSense Ad units to your blog manually

Once your account is approved, you will get an email confirming that your account is now ready to show ads. 

Generally, it takes anywhere between 24 to 48 hours to get approved for Adsense. Sometimes it can even take up to 1 to 2 weeks.

Now you will have two options. Either create ad units and add them manually or you can enable auto ads.

Before I show you how to create ad units, you must understand where each ad unit should be placed on your website.

Here is a video from the Google AdSense channel that will help you understand ad units:

Now, that you have a better idea about ad units let’s start with creating ad units manually first.

Shall we?

Head over to your Adsense dashboard click on “Add” and press “Overview”.

Click on “By Ad Unit” and press on “Display Ads”.

Here you will get the option to choose from different ad formats.

You will get three choices:

  • Square ads – Perfect to display between paragraphs of your content
  • Horizontal ads – Usually placed on the top or just after the end of your content
  • Vertical ads – This is usually placed in your sidebar

For this tutorial, let’s create an ad unit that you will place in your sidebar (Be sure to select the responsive-top right of your screen).

Add a name to your ad unit, and press on “create”.

Now you will get a code that you must paste on your blog. Select and copy the code.

There are two ways to do it. You can add the code manually or you can use a plugin.

First, let’s see how you can add the code manually.

Head over to your WordPress dashboard and navigate to “Appearance” and select “Widgets”.

Select the “Custom HTML” and drag it to your Main sidebar. Now paste the code and click on “Save”.

Voila. It’s done.

Simple isn’t it?

5. How to add and enable auto ads to your WordPress blog

Now if you don’t want to add codes individually, you can let Google determine the best places to show ads on your blog.

This option has allowed more people to use Adsense on their blog as they will have just to paste a code in The Header section of their blog.

One way to add the code is to insert it in your header PHP file.

But, there is a catch.

If ever you change your theme the code will disappear. Therefore the best option is to use a plugin to solve this problem.

You will need to install and activate Insert Headers and footers plugin.

So head over to your WordPress dashboard and install and activate the plugin. Once activated, head over to “Settings” and select “Insert headers and footers”.

Once you have pasted the code click on save.

The plugin will now add the code to all your pages and post. All you have to do is just wait till Google Adsense starts to show ads on your blog.

6.Bonus: Google Adsense Best Practices

Here are a few things that you should do:

  • You should always abide by Google Adsense terms of services to get approved quickly. 
  • Try different units to see which ones are performing better.
  • Quality content is the foundation and key to getting more out of your blog. The longer the content the more ads you can display.
  • Make sure your blog is mobile-friendly and always strive to make your blog faster.
  • Try to conduct Google experiments to see which ads work best.
  • Always try to increase your Page’s RPM to increase your revenue.

Few things that you should avoid:

  • Do not add too many ads to your blog. The ideal number of ads is between 3 to 5.
  • You should never click on your ads nor ask family and relatives to do that for you. Google is pretty smart, and it will notice such behaviors. You don’t want your Adsense account to be canceled. Right?
  • Don’t buy traffic.

Final thoughts: How to add AdSense code in your WordPress blog

I hope by now you know exactly how you can add Adsense code to your WordPress blog.

If you want to increase your Adsense revenue, you should focus on creating quality content and bring more traffic to your blog.

Here are a few resources that will help you with that:

If you liked this post, please don’t forget to share it so that others can benefit from it.

See you soon!

Leave a Comment