How to Add Google AdSense to WordPress (With Plugins and Manually)

Share This:
Google Adsense

One of the most common ways to monetize your site is by running ads on it. Google AdSense is Google’s platform that lets any website owner-run ads on their site and make money from it.

If you want to get more from Google AdSense, or you like the idea of making some money from your site, this guide will help you learn more about how Google AdSense works and how to use AdSense on your WordPress site.

What is Google AdSense?

Google AdSense is probably the most famous platform you can use to run ads on your websit. Those ads are served by Google, based on the browsing history of the people visiting your site.

So when one person visits your site, they’ll see different ads from another person. For example, if you run a travel blog, you’d show ads related to booking sites. If you’re running a business site, ads from B2B companies would show up.

But Google AdSense is more intelligent than that. It knows what each individual who visits your site has looked at online and will tailor the ads according to that information. Meaning that they’re more likely to click on the ads, hence you’re more likely to make money from them.

Google AdSense vs Google Adwords

Google Adwords is Google’s other advertising platform, but it does a very different job.

Instead of letting website owners display ads, Google Adwords lets you create ads that will be displayed on Google’s search result pages.

Now, back to Google Adsense…

Pros and Cons of Running AdSense on Your WordPress Site

Why run other people’s ads on your site? After all, your site exists to promote your own business.

There are some scenarios in which you wouldn’t want to run third-party ads. Instead, you might choose to place ads for your own products, encouraging people who’ve found your site to browse your products.

If you want to do this, you can use the plugins described in this post to place your own ads into your site, without using AdSense.

But if your site has regular traffic and isn’t making you money directly by selling products or services, running ads is a good way to make some cash from your site. So if your WordPress site has a significant audience but isn’t directly selling to that audience, ads can be a great way to make some money from it.

How to Create a Google Adsense Account

So you’ve decided to run ads on your WordPress site with Google Adsense. How do you get started?

The first step is to set up an AdSense account. To do so, start by going to the Google AdSense website.

Here, you’ll need to add your website address and your email address. Choose whether you want to be added to the mailing list for tips on running ads. Enter those and click the Save and Continue button.

If you already have a Google account, your account details will then appear so you can confirm you want to use that account. If you don’t, click the Use a Different Account link and sign in to the account you want to use. Or if you don’t already have a Google account, you’ll need to set one up.

Select your country or territory, read and accept the conditions, and click Create Account.

You’ll then be taken to a screen which will take you through the process of setting up your account. Click the Get Started button.

Start by typing in your contact details (or checking them if you have an existing account). Click Submit to continue.

You’ll then be shown some code you can use to connect your site to AdSense. Which is what we’re going to look at next.

What to Do If Your AdSense Account Isn’t Approved

Once you’ve set up your account, you’ll have to wait for Google to verify your details and approve your account before you can run any ads. Sometimes your application for an account may be rejected.

If this does happen, you will be sent an email with the reasons your account has been ‘disapproved’. In most cases, the cause is related to issues with your website, which might include lack of content, code or security issues, or content that Google believes is plagiarized.

If your site is brand new, it’s got a higher chance of being rejected because of lack of content. Google wants to know its ads are being served on high-quality, genuine websites that will drive traffic to those ads.

So instead of reapplying instantly, take some time to improve your site. Add more content to it. Fix any security issues. Make sure everything you publish is yours or you have the right to publish it, and you haven’t copied it from elsewhere on the internet.

Once you’re confident you’ve solved any problems Google warns you about, and that your site is working well, then you can reapply.

You don’t have to wait until your account is approved to connect it to your site though, so let’s move on to doing that.

How to Connect Google AdSense to Your WordPress Site

The next step for adding Google AdSense to WordPress is to hook up your WordPress site to your AdSense account. This way Google is able to serve ads correctly.

You’ll already have noticed that Google Adsense gives you some code you can add to the <head> section of your site. Resist the temptation to open up the theme editor in your dashboard and type it in. When you update your WordPress theme, the new code will be lost and your ads will break.

Instead, use one of these options.

Connect WordPress and Google AdSense with a Plugin

The easiest way to add Google Adsense to WordPress is to use an Adsense plugin such as Advanced Ads.

This will let you add the code to your site without having to access files and will also manage the process of displaying ads for you without you having to use widgets. It also gives you a Gutenberg block for ads so you can add them wherever you want in your posts.

Here’s how you add the code for your Google Adsense account using this plugin.

Start by installing and activating the plugin. Go to Advanced Ads > Settings and then click the AdSense tab.

Click the Connect to Adsense account button. You’ll then be prompted to sign in to Google with the same account you used for AdSense. Once you’ve done that, you’ll be asked to confirm that you’re happy for the plugin to access data from Google Adsense.

You’ll then see a screen with a code for you to paste into the application. Copy this, then close the popup. Paste it into the screen that appears next.

The AdSense tab will now populate with the details of your account.

The top field will have your unique AdSense account identifier. Below that there’s a checkbox for adding the verification code. Check that so that the plugin can add the code to your site’s <head> section. Then click the Save settings on this page button and move on to verifying the code.

Add AdSense Code to Your WordPress Site’s Head with a Plugin

If you don’t want to use a plugin to manage the whole ads process and you also don’t want to  (or are unable to) edit the code in your theme, you can use a plugin to add code to the header or footer of your pages (in this case, it’s the header).

The Head, Footer and Post Injections plugin lets you copy code into a settings screen that is then inserted into the head or footer of your site.

Install the plugin, and then go to Settings > Header and Footer.

Header and Footer Plugin Settings

Now get back to your Google AdSense account and copy the code that Google gives you to link your site. Return to WordPress and copy it into the <HEAD> PAGE SECTION INJECTION ON EVERY PAGE field.

Click the save button. Now skip to the section on verifying the code with AdSense.

How to Manually Add Google AdSense Code to Your WordPress Site

The next option is to manually add the code that Google AdSense gives you to your WordPress theme. This is the more lightweight approach, without the extra code that a plugin adds, and could be your preferred option if you’re comfortable editing your theme.

If you’re using a third-party theme on your site, you must never directly edit the code in the theme. This is because any changes you make will be lost when you next update the theme.

If that’s the case, you’ll need to create a child theme. Replicate the header.php file from your parent theme, then edit that. WordPress will use that file instead of the one from the parent theme.

If you don’t want to go to the trouble of doing that, it might be easier to use one of the plugins above.

Open the header.php file in your theme and find the <head> section, which is at the beginning fo the file.

Scroll down the bottom of this section and find the line that says wp_head();.

Above that, copy in the code provided to you in your Google Adsense account. Save the file.

Now skip to the section on verifying with AdSense.

Manually Add Google AdSense Code Through a Custom Plugin

If you’re happy writing plugins, then another way to add the code is to write your own plugin.

Read More: How to Install a WordPress Plugin

Share This:

Popular on WPSteam Right Now!

Leave a Reply

Your email address will not be published. Required fields are marked *

I need help with...