How to Insert AdSense Ads in WordPress?
Nowadays blogging is becoming one of the accepted professions among youngsters. Most important reason for that is bloggers believe they can make money with their blog. This confidence was built over long period of time and Google plays a vital role in this. Google AdSense is one of the most reliable and popular pay per click monetization method for bloggers and site owners. The hard work to get traffic to your blog can also pay you proportionately by placing advertisements on the content.
On other hand blogging becomes easy for most of us with the platforms like WordPress. So it makes real sense to combine the power of WordPress blog with the earning potential of AdSense. Believe us, over the period of time this can make you millionaire without doing physical product business.
In this article let us explore all the possibilities of inserting Google AdSense advertisement codes in your WordPress blog.
Getting AdSense Ad Code
The first step is to apply for AdSense account with your blog and get approved from Google. This is a simple and straight forward process. It is recommended to run your blog for at least six months to have a decent traffic before applying for AdSense approval. Once the account is approved, you need to create ad codes and place on your site for displaying ads.
We have the following article that can help you to learn more on AdSense:
- What is Google AdSense?
- How to make more money with AdSense?
- Various AdSense ad formats
- Creating ad unit in AdSense account
- AdSense Ad placement
Where to Insert Ad Codes in WordPress Blog?
Google had an official AdSense WordPress plugin for inserting ad codes in WordPress sites. Unfortunately this plugin was discontinued and you need to follow other methods. There are two areas on your site, you can place advertisements.
- Widget area like sidebar and footer
- Content area like before and after content, in-between content or on random place on the content
How to Insert AdSense Ads in WordPress Blog?
There are many ad formats you can use depending on the placement. We recommend to create responsive ads for widget area and in-line ads post content area. Create and copy your AdSense ad code, you can use single ad code throughout your site.
Inserting Ads on Widget Area
WordPress offers a “Custom HTML” widget to insert any custom codes on the sidebar and footer widget area. Login to your WordPress admin panel and go to “Appearance > Widgets” section. Drag and drop “Custom HTML” widget on your sidebar or footer area.
Now paste your AdSense ad code inside the “Custom HTML” widget and save. Open you site and check the ads are displaying properly. Remember, it may take some time for the ads to display. Till the time you will see a blank space or the backup ad as per your settings in AdSense account.
Inserting Ads on Content Area
There are no default options available in WordPress to insert ad codes on your content area. You have two options here:
- Modify the PHP templates
- Use plugin
Modifying PHP Templates
Generally the post template in WordPress is “single.php” for posts and “page.php” for pages. You can check the templates under “Appearance > Editor” section by choosing the installed theme on your site. The templates will be displayed on the right sidebar and check the correct template used by your theme.
Choose the correct template file and insert the AdSense ad code where you want. We recommend to create a child theme and inert the ad codes in the templates so that the changes are not deleted during theme update.
The page-level ad code for mobile need to be inserted in the “header.php” so that it will appear throughout the site. Similarly, you can choose “archive.php” for inserting ads on blog index and other archive pages.
Using AdSense Plugin
Template modification is an easy way for inserting ads below title and after content. But it will not help to insert the ad in-between the content, say after four paragraphs on all the posts on your site. Here comes the use of plugins. Basically any code snippet plugins can be used for inserting AdSense ad codes.
For example, you can use “Insert HTML” plugin for inserting unlimited AdSense ad code wherever you want on the content area. Again the problem is you should manually insert the code on each posts which may be time consuming. Also difficult to open all old pages and insert the ad code in one by one.
The solution is to use dedicated AdSense plugins like Ad Inserter. Install the “Ad Inserter - WordPress Ads Management” plugin and activate it.
Go to the "Settings > Ad Inserter" menu, paste your AdSense ad code and save the block. This plugin allows to create up to 16 ad blocks which can be used as you need.
Below are some of the options for inserting the ads:
- Before and after post content
- Insert before or after comment section
- Insert in header of footer
- Insert before or after certain number of paragraphs
Ads can be inserted automatically based on the settings or you can use shortcode to insert manually in-between post content and also on the widget area.