How to Integrate Google AdSense on your WordPress Site

Header image for WordPress AdSense

Last updated - February 24, 2020

Sustaining a WordPress site is not an easy matter. You need to find several ways to monetize your site if you are planning to maintain your site long term. Google AdSense is a great way to display advertisements on your site, from which you can earn an income. In fact with the managed AdSense program of Google you are saved from the hassles of dealing directly with advertisers. Google will manage that part for you and provide you with the earnings associated with the ads. This article will explain the process of WordPress AdSense integration, which can be done without much hassles.

WordPress AdSense integration

Basically, the process of WordPress AdSense integration involves three steps. First, you need to signup for Google AdSense. After that, you have to create your ad and generate a code. Finally, you can paste this code on a custom HTML widget on your WordPress site to display ads managed by Google.

Now, let’s see the process in more detail.

Signing up for Google AdSense

To Signup for the AdSense program, you need to have:

  • your website url
  • gmail account

You need to create a Google account to be able to use Google AdSense. If you already have a gmail account, you can use that to signup for Google AdSense as well, else create a new one.

On the home page of Google AdSense, click ‘SIGN IN’ on the top right.

The next screen will ask you for your website url and email ID. Enter these details and click the ‘SAVE AND CONTINUE’ button.

Image depicting the AdSense signup screen as the first step for WordPress AdSense integration
For WordPress AdSense integration, you have to first signup on Google AdSense with your gmail account and website url

Now, Google will take some time to review your application to join the AdSense program. Basically, they will check if your website qualify for the program according to the terms and conditions. The terms include clauses like the account holder has to be over 18 years of age and should hold only one account. You may want to read the terms and conditions specific to the country (of your billing address) in detail before signing up.

Once you get your application reviewed and approved by Google, you can start creating your first ad.

Create an ad and get the JS code

You will get an email from the AdSense team informing on how to activate the account. Once your account is activated, you can go ahead and create the first ad. Sign in to the AdSense account and go to MyAds > Content > Ad units. Now, click the +New ad unit button to create a new ad.

Screenshot showing the process of creating a new ad unit for WordPress AdSense integration
You need to sign in to Google AdSense and create a new ad unit to get started with.

Once you click the +New ad unit button, you have to select the desired ad type that you want to feature on your website.

Three choices are available here.

  • Text & Display Ads
  • In-feed Ads
  • In-Article Ads
Type of ads for WordPress AdSense integration
You need to choose a type of ad that you want to display on your site.

Let’s quickly look at the features of each:

Text & display ads are the simplest way to go about. You just need to choose the placement, size and style of the ad and you are good to go. If you are just starting out with the program, you can very well choose this option to avoid any complexities at the beginning.

In-feed ads are placed inside a feed on your site. A feed would be typically a set of products or articles listed on your site. Because it does not intrude the user’s flow, in-feed ads are considered to better for user experience. Also, they are better suited for mobile screens and are highly customizable.

In-article ads are displayed between paragraphs inside an article. Again, due to their placement between paragraphs, these ads too are designed to not disrupt the user’s flow.

Select the type of the ad that you want to display on your site.

On the next screen, you will be able to specify the following features for the ad unit.

Name – You can specify a name for the unit, which is just for your knowledge. For example, you can name something like “Yoursite side bar”.

Ad size – You can choose the size of the ads here. Google recommends to choose wider sizes. Also some sizes won’t be able to display certain ads. It is better to read the documentation thoroughly to understand how different sizes would impact.

Ad type – Here you can choose to display either text or display ads or both together. Google advises to choose both, as you will be able to include ads by most advertisers that way.

Text ad style – This gives you control over the look of the ads featured on your store.

Custom channels – This options allows you to group ads together by different parameters.

If no ads available – Here you can specify the display options in case Google does not have a targeted ad. You can choose a blank space, solid color, or an image of your choice.

Finally click the Save and get code button to get the JavaScript code.

You can specify a name and type of the new ad unit along with other features.

Now, you will see a modal window with the JavaScript code and a message saying the ad was successfully created. You need to copy this code, which needs to be pasted on a widget on your WordPress site.

After the ad is successfully created, you will get a javascript code which you need to paste on your WordPress site.

WordPress AdSense integration with custom HTML widget

This is the easier part. Just login to the admin side of your site. On the admin panel, navigate to Appearance > Widgets. Drag and drop a Custom HTML widget to the sidebar area and paste the JS code in the content section of the widget. Finally, click the Save button and you are done!

You need to paste the JS code inside a custom HTML widget, which in turn will be displayed on the sidebar of your site.

You should take a look at the front end of your site, to make sure the ad is displayed in the way you want it.

Use the help of a plugin to manage ads

As is the case with every other functionality that you can think of, there are quite a few plugins options to manage WordPress AdSense integration too. Google had its own plugin for this, however it was discontinued after a while. If you are looking for the support of a plugin to help you manage ads on your store, then read the below section.

WP In Post Ads

This plugin helps you gain the full advantage of Google AdSense program on your WordPress site. In fact, it will help you maximize the monetary benefits from your site. One of the important features of this plugin is the option to do split test for your ads. You can test different positions for ads on your site, and choose the one that brings in most revenue. It also provides a count of your ad views, so that you will be aware of the rate with which your ads are getting viewed.

image for WP In Post Ads for WordPress AdSense article
This plugin provides solid assistance to manage ads on your WordPress site.

The plugin also offers the flexibility to place the ad in different positions on your site. For example, you can place the ad right after the post title, or right at the bottom after all the content. It also gives you the flexibility to choose after where all to insert ads, when you are placing ads between paragraphs. Another great feature is the availability of the short code option to place ad wherever you choose.

WP In Post Ads plugin also gives you the option to selectively display or hide ads within a particular time interval that you decide. It also helps you to manage ads specifically for individual posts. Furthermore, you can choose to not display ads to logged in users with the help of this plugin. The price of a single site license of this plugin is $39.

Advanced Ads

This is a simple plugin that can be used in several ad networks. It has solid features to help you with your Google AdSense ads too. The plugin supports all types of ads in AdSense. With the help of this plugin, you can change the size and type of an ad without logging into your AdSense account. It ensures that no ads are displayed on your 404 pages, as per the guidelines. Moreover this plugin helps with Ad Health integration and AdSense violation checks.

This plugin helps you manage your site advertisements on Google AdSense as well as other ad networks.

With over 60,000 active installs and prompt support, this plugin can be a handy tool to manage your Google AdSense ads.

Best practices to increase your ad revenue

As you have seen, setting up ads on your WordPress site with the help of Google AdSense account is quite simple. However, Google advises website owners to follow a set of guidelines to get the best out of your AdSense program. Let’s take a quick look at a few of them:

Try out different ad types

While creating an ad unit, you might have noticed that there are different ad types. Google recommends to try a mix and match approach to see which is the most beneficial option for your site. Your site visitors are of a variety of tastes and interests – some might prefer links, while some prefer video blocks. It is important that you have an option that is suitable to all type of visitors. In addition, when you are featuring different ad types on your site, there are chances to include a bigger range of advertisers too.

Choose what works for your domain

Internet is a place where you can easily find domain specific behavioral patterns. It is important to understand this aspect while placing ads on your site as well. For example, Google recommends entirely different ad placements for the homepages of a news website and for a travel site. Another strategy would be to observe how your competitor sites are placing ads. This will give you a good referral point to start with your AdSense plan.

Though there are recommended options, it is always advisable to test them yourselves for best results. For example, you can place an ad according to the general recommendation for a specific period of time. After that you can try out a competitor strategy for another short period. Finally, you can compare both strategies and choose the one that brings in better returns.

Make sure you are adding new content to your site

Your website traffic grows when you are consistently creating new, relevant content on your site. In addition to that, make sure you are following all the SEO best practices, to get a better ranking on searches. Overall, your ad revenue will be majorly dependent on the number of visitors to your site.

Use strategies to improve the popularity of your site

You should focus on several aspects that would help to improve the popularity of your site. These may include natural back link building by connecting to blogger networks and similar websites on the domain. Similarly, you can leverage social media channels too to promote your website.

Mobile friendliness

Mobile users constitute a major portion of traffic on most sites. You need to consider this factor while creating ads too. The best approach is to check Analytics data to understand whether there is a major section of mobile users in your site traffic. If your mobile traffic is of a considerable number, it is better you make your ads responsive too. This way they won’t look odd on a mobile device.

You can read the best practices in detail here.


Ads are a great way to increase revenue on your site. You can effectively use Google AdSense option to create a hassle-free advertisement option on your site. Simply with a Google account, you can set up this option on your WordPress site. This article has outlined the process for WordPress AdSense integration. Also, keep in mind that the success of any ad program is directly related to the growth of traffic on your site. Let us know if you would like to share some insights on Google AdSense.

Related Reading