How to Properly Add Google AdSense to Your WordPress Site

Google AdSense is one of the most popular ways for website owners to monetize their content by displaying ads. With AdSense, Google handles all the heavy lifting – they provide the ads, place them on your site, and handle payments to you. All you have to do is add a small snippet of code to your WordPress site.

In this complete guide, we‘ll walk through how to properly set up Google AdSense on your WordPress site to start earning money from ads.

What is Google AdSense and How Does it Work?

Google AdSense is an ad network run by Google. It allows publishers (people who own websites) to sign up and paste a piece of code on their site. This code will automatically pull in targeted ads and display them on your site.

When visitors on your site click on these ads, you get paid by Google. The payment rates vary depending on the ad, but are usually between $0.10 to $1.00 per click.

Google AdSense is beneficial for both publishers and advertisers:

  • For publishers, AdSense provides a hands-off way to monetize website content without having to find advertisers and manage ad placements yourself.

  • For advertisers, AdSense allows getting their ads on high-quality sites relevant to their business. When done right, it provides good returns on ad spend.

Essentially, Google acts as the middleman facilitating this entire process through advanced targeting and machine learning algorithms.

Why Use AdSense for Monetizing Your Site?

There are many benefits of using AdSense over other types of advertising:

It‘s easy to set up. You simply sign up for an account, get a small code snippet, and add it to your site. There‘s no need to find advertisers or negotiate deals.

Google handles everything. They find relevant advertisers, pull high-quality and safe ads, track clicks and impressions, and handle all payments to you.

Ads are targeted. The AdSense code automatically pulls in ads targeted to your site‘s content and audience. This means higher click-through rates.

Wide variety of ad formats. You can choose from display ads, text ads, video ads, and more depending on your site‘s layout.

Works for sites of any size. AdSense can work for small hobby blogs to large media publications. The code seamlessly adapts to your site‘s content and pageviews.

You only pay for results. With AdSense, you earn money when visitors click on ads. You don‘t pay anything upfront to show ads.

Payments are reliable. Google has been successfully running AdSense for almost two decades now. Publishers get paid reliably every month.

Real-time performance data. The online AdSense dashboard provides detailed stats on impressions, clicks, CTR, earnings, etc.

Overall, AdSense provides an easy way to earn passive revenue from your website without major time investments. Next, let‘s see how to actually add it to your WordPress site.

Step 1 – Sign Up for an AdSense Account

The first step is to sign up for a Google AdSense account if you don‘t have one already. Here‘s how:

  1. Go to the Google AdSense homepage.

  2. Click on "Sign Up Now" and fill in your information like name, email, and country.

  3. Agree to AdSense terms and conditions.

  4. Submit your application.

Once submitted, Google will review your website (if you already included the URL during sign up). The review process can take a few days to a few weeks in some cases.

Make sure your site is fully functional and has some content before applying. Also, read through Google‘s program policies to ensure your site meets the criteria.

When approved, you‘ll receive an email from Google inviting you to sign in and access your new AdSense publisher account dashboard.

Step 2 – Generate Your AdSense Ad Code

Once your AdSense application is approved, you need to generate the actual ad code to add to your WordPress site:

  1. Sign in to your AdSense account and click on "Ads."

  2. Click on the drop down and select "Ad units."

  3. Click on the large blue "+ NEW AD UNIT" button.

  4. Enter a name for your ad unit (like Website Homepage Header).

  5. Under ad types, select the type you want like Display or InArticle ads.

  6. Choose your ad sizes and whether you want responsive ads.

  7. Click "Continue" and then click "Create ad code."

  8. Copy the generated code and save it in a text editor for now.

You now have your actual AdSense ad code required to display ads on your site. The next step is adding this code in the proper place in WordPress.

Step 3 – Add the AdSense Code in WordPress

To actually display ads, you need to add the AdSense code you generated to the appropriate theme files or WordPress pages. There are a few ways to do this:

A) Add Code to Theme Using WPCode Plugin

The easiest method is to use a plugin like WPCode that allows adding code snippets in your header/footer without editing theme files.

Simply install WPCode, activate it, and paste your code in the header section. This will add the AdSense code across all pages on your site.

The benefit of using a plugin like WPCode is that your code gets saved securely regardless of theme changes.

B) Manually Add Code to Theme

Alternatively, you can manually add the AdSense code by editing your theme‘s header.php or footer.php file:

  1. Login to your WordPress site and go to Appearance → Editor.

  2. Open the header.php file of your activated theme.

  3. Paste the AdSense code snippet just before the closing </head> tag.

  4. Click Update File.

Manually adding code directly works too but can cause issues when changing themes and during WordPress updates. Using a plugin like WPCode is the safer option.

C) Use Ad Inserter Plugin

Another option is using a dedicated ad management plugin like Ad Inserter. This gives you fine-grained control for placing ads across your site.

You can designate on which specific pages, posts, categories you want the ad to appear. There are also advanced settings for ad timing, frequency, and more.

The benefit of using Ad Inserter is maximum flexibility in ad placement, though it can have a learning curve.

D) Use Ads Widget on Sidebar

If you only want the ad to appear in your sidebar, use a text widget:

  1. Go to Appearance → Widgets in WordPress.

  2. Add a new Text widget to your desired sidebar.

  3. Enter your AdSense code in the widget settings.

  4. Click Save.

This will nicely add the AdSense code only to your sidebar area without affecting site-wide coding.

Step 4 – Set Up Google Auto Ads (Optional)

Instead of manually placing ads, you can also enable Google Auto Ads which automatically determines the best placements for ads:

  1. In your AdSense account, go to Ads → Overview.

  2. Scroll down and enable "Place ads automatically."

  3. Click "MANAGE SETTINGS."

  4. Toggle on the switch for "Place ads automatically on: [your site‘s URL]"

  5. Click SAVE.

  6. Grab the auto ads code snippet and add it to your site using WPCode or theme header code.

With auto ads enabled, Google will dynamically serve ads in real-time optimized on your content and page layout. However, the downside is you lose manual control over ad placement. We recommend starting with manual ads and testing auto ads later once your earnings stabilize.

AdSense Optimization Tips and Tricks

Here are some tips for optimizing your AdSense setup and increasing revenue:

  • Experiment with different ad sizes and formats. See which ones perform best.
  • Use ad management plugins like Ad Inserter or AdSanity to find the highest converting ad positions.
  • Make sure your ads are visible on the page and not buried under too much text or images.
  • Don‘t have too many ads clustered together. Give your content room to breathe.
  • Keep an eye on your click-through rate (CTR) and optimize when it drops too low.
  • Stay away from practices like auto-refreshing ads, pop-ups, harvesting competitor ads, etc.
  • Write high-quality, original content consistently to keep bringing in human traffic.
  • Avoid sites with mostly automated traffic like bots, scrapers, etc. They dilute your earnings per impression.
  • Don‘t click on your own ads or try to game the system. You may get banned by AdSense.
  • Make sure your site provides a good user experience. Ad blocker usage decreases CTR.

With the proper setup and optimization over time, Google AdSense can become a significant revenue stream for your WordPress site without much effort.

AdSense FAQs

Here are answers to some frequently asked questions about implementing AdSense:

Q: What are the requirements to get AdSense approved?

Google looks for sites with good user experience, unique content, and ethical practices. Your site should be at least 6 months old with regular human traffic.

Q: How much money can I make with AdSense?

Earnings vary greatly by niche, traffic volume, country, ad placement, etc. For new blogs, plan on an average of $1 RPM (revenue per thousand pageviews). Well-optimized sites can achieve $5 to $15+ RPM.

Q: When does AdSense pay out?

Google pays registered bank accounts on the 21st of each month for the previous month‘s earnings. You need to cross a $100 minimum payout to get paid.

Q: Does AdSense work with affiliate marketing?

Yes, you can use AdSense alongside affiliate programs. Just don‘t directly monetize affiliate links with AdSense. Google doesn‘t allow this.

Q: Can I use AdSense on multiple sites?

Yes, you can use one AdSense account across any number of sites. Each additional site will require submitting an application again for approval.

Q: Why was my AdSense application rejected?

This usually happens if Google finds policy violations, suspicious clicks activity, or feels your site needs more development before applying. Improve your site and apply again.

Q: How many ads should I show per page?

One or two ads above the fold are enough for most sites. Don‘t bombard users with too many ads. It leads to banner blindness resulting in lower CTR.

Q: Is Google AdSense free to use?

Yes, Google AdSense is completely free to join. You only pay Google a small percentage cut of your earnings. There are no signup costs or monthly fees.

Conclusion

Implementing AdSense is a relatively straightforward way to monetize your WordPress site through relevant advertising. Start by adding it to your blog using the methods outlined in this article.

Over time, optimize your ad sizes, placements, site content, page speed, etc. to maximize revenue. This hands-off monetization along with other options like affiliate marketing can earn you a nice passive income from your WordPress site.

Written by Jason Striegel

C/C++, Java, Python, Linux developer for 18 years, A-Tech enthusiast love to share some useful tech hacks.