How to Use Google Adsense with WordPress

Google Adsense is one of the most popular monetization methods for blogs and websites. The concept is simple. If a user clicks on an ad, you get paid. In this tutorial, I’ll show you how to use Google Adsense with WordPress.

Using Adsense with Widgets

Two popular places to display Adsense ads are the header and sidebar widget areas. Generally, I recommend using the 729x90 size for the header, and the 300x250 size for the sidebar. Google also has a responsive ad module, which selects a suitable ad to display based on the visitor’s screen size.

  1. Copy your ad code by clicking on Get Code on the Adsense dashboard.
  2. https://gist.github.com/bwhli/50ded6f75a261d025402
  3. On your WordPress site, click on Widgets under the Appearance tab.
  4. Drag a Text module into your widget area of choice, paste the Adsense code into the box, and click Save.

Google Adsense ads should now display on your website. Keep in mind that newly created ads can sometime take awhile before they start displaying. If you’re displaying a 300x250 ad in a sidebar wider than 300px, I recommend centering the ad by wrapping the code inside <center></center>.

Using Adsense in Post & Page Content

You can display Google Adsense ads in post and page content as well. This can be achieved quite easily with the Ad Inserter plugin. Navigate to Ad Inserter under Settings on your WordPress dashboard after installing the plugin.

Ad Inserter lets you create “ad blocks” with different ad code and settings. To create a new block, just paste your ad code into an unused slot. Ad Inserter also lets you customize how and where a particular ad block is displayed.

  • Automatic Display embeds an ad block in the selected area.
  • Block Style lets you choose how an ad block is formatted.
  • Block enabled on lets you enable or disable display on posts and pages.

Near the bottom of the settings page is an option to Enable manual insertion with shortcode. I recommend enabling this option because it allows you to display an ad block anywhere on your site with a shortcode! This is the recommended method to display ads in post/page content because it allows you embed ads in specific areas.

I hope you enjoyed this tutorial on how to display Google Adsense ads on your WordPress site. Leave a comment below if you have any questions or concerns!

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.