While earning money shouldn’t be the main reason for daring to become a blogger, it motivates many. Simultaneously, it’s a source of struggle, confusion, and can expose a lack of skill. If you were only your own, you’d have to wait for your website to reach prominence, then combine business and marketing knowledge to barter sponsorships, sign contracts, and place advertisements without annoying your visitors or having them find you insincere. Luckily, there’s no need for that, since Google AdSense takes care of everything for a “finder’s fee”. If you can live with that, let’s get straight into how to add AdSense in WordPress.
1. Sign up for Google AdSense
Visit the Google AdSense Start page and click on Get started. Then, do the following:
- Enter the URL of your website with HTTP/HTTPS in front.
- Enter the contact e-mail address. It must be an existing or new Google account.
- We recommend selecting Yes, send me customized help and performance suggestions.
- Click on Save And Continue.
- On the next page, select your country and territory.
- Agree to the Terms and Conditions and click on Create Account.
- Click on Get Started, and start filling out your personal information: Address, zip/postal code city, and phone number (optional).
- Click on Submit to continue.
2. Add the Google AdSense verification code
On the “Connect your site to AdSense” page, you’ll see a code in the Your AdSense code section. Although it says to add it between the <head> and </head> tags, don’t. If you do, your ads will break the next time you update your WordPress theme. Instead, use one of these alternatives:
1. Edit the child theme
The most lightweight method of adding the Google AdSense code for verification is editing your child theme in WordPress. That way, the code will persist through theme updates. Here’s how it works:
- Access your WordPress website via FTP.
- Open the header.php file in your WordPress child theme folder (wp-content/themes/child-theme/).
- Find <head> at the beginning, then scroll down to find wp_head();.
- Paste the AdSense code for verification above the latter tag and save changes.
2. Use a WordPress plugin
If you don’t like modifying your WordPress files, you can also insert an AdSense verification code by installing a WordPress plugin. The first option is the plugin mentioned in method 3 of editing the header in WordPress. The second is more complicated:
Using an AdSense plugin
Install any of the AdSense WordPress plugins. Doing so will not only let you add a verification code, but also add and edit ads manually in later steps. Plus, you’ll get a Gutenberg block to insert ads into posts and pages. So, if you plan on skipping auto-ads, you might as well use this method from the get-go. We’ll use Advanced Ads (https://wordpress.org/plugins/advanced-ads) for demonstration:
- After installation and activation, click on Advanced Ads, then Settings.
- Switch to the AdSense tab, then click on Connect to AdSense account.
- Sign in, confirm that you acknowledge the plugin will use Google AdSense data.
- You’ll now see a screen with a code. Copy it, then close the prompt.
- Paste it into the prompt that appears next.
- You’ll now see your AdSense data within the plugin screen.
- In the top corner, below your AdSense account identifier, there’s a checkbox to add the verification code.
- Put a checkmark to allow the plugin to add the code to your <head> section.
- Click the Save settings on this page button.
3. Wait for review and approval
Go back to the AdSense page, click on I’ve pasted the code into my site, and click on Done. As you can see, ads don’t appear on your website yet – Google must manually review your application and approve your account. This can take a few hours, a full day, or even a week or two. Even worse, your application might get denied.
4. Place Google AdSense ad code in WordPress manually (Option 1)
Now that you’re approved, do this to insert AdSense ad unit codes into WordPress manually:
1. Create the AdSense ad unit and paste the code manually
On the Google AdSense page, click on Ads > Overview in the left sidebar. Switch to the By ad unit tab, and then follow these steps to start creating a new ad unit:
- Click on Create New Ad.
- You can now choose between 3 types of ads: Display ads, In-feed ads, and In-article ads.
- Since you’re new, we’d select Display ads.
- Now, edit the ad name in the upper left corner. It can be anything, since it’s only for internal use.
- In the Ad Size section, choose or enter one of many sizes.
- Note. We suggest keeping the size low, especially with sidebar placement, as we’ll demonstrate. The goal is for ads to fit as many screen sizes, and be mobile-friendly. For that reason, we suggest 336×280 and 300×250 sizes, both of which are popular among advertisers.
- Between Fixed and Responsive ads, we recommend the latter option.
- Finally, click on the Create button to finish the process.
- Google will now show a “Code generator” prompt. You’ll see ad codes in 2 tabs, HTML and AMP.
- Tip. You should only use the latter if you’re using a Google AMP version, which many webmasters willingly avoid.
2. Place AdSense ad unit code in WordPress
After copying the code in the HTML tab, decide on the position of the ad. Since ads are frequently displayed in the sidebar, we’ll demonstrate 2 ways to do that:
1. Add it as a widget
This is the least resource-intensive method. Follow these instructions to insert ad unit as a widget in WordPress:
- In the left sidebar of the WordPress Admin Dashboard, click on Appearance > Widgets.
- Drag the “Custom HTML” widget to the Sidebar widget area.
- Edit the widget and give it any name in the Title: text field.
- Paste the HTML code in the Content: text box.
- Save changes.
2. Use an ad management plugin
If you’re unhappy or find it too hard to place ads throughout your website, we suggest installing any of the ad plugins for WordPress. Using the above-mentioned example of Advanced Ads, you’d do this:
- Go to Advanced Ads > Ads.
- Click on the AdSense Ad radio button and then Next.
- The plugin should load the ad unit from AdSense. Select it and click on Next.
- Tip. If it doesn’t, simply copy the HTML code manually and click Next.
- Configure the conditions and location for the ad appearance and save changes.
5. Add Google AdSense auto-ads code snippet in WordPress (Option 2)
After adding a single code snippet, AdSense will automatically figure out the best ad sizes, types, and locations on your website and display ads. If that sounds perfect for a beginner, add auto-ads AdSense auto-ads like this:
- Sign in to AdSense, then go to Ads > Overview > By site tab > click on Get code.
- Copy the auto-ads code snippet Google generated.
- Google will now instruct you to add the code into the header of every page. We already explained that’s a bad idea and is also labor-intensive.
- Instead, we recommend repeating step 2, sub-step 2 above, e.g., using the Insert Headers and Footers plugin or an equivalent.