Home / Adsense / Quick Guide: How To Add Adsense Code To WordPress
Quick Guide: How To Add Adsense Code To WordPress
In the sign-up process for Adsense account, you will be asked to add Adsense code on your website for account review. However, you’ll only see blank Adsense ad units on your site until your Adsense account is reviewed.
Once your account gets approval, you can further add Adsense code on your site for earning revenue.
It’s easy to add Adsense code on any blogging platform or website. In fact,WordPress makes it easy to add Google Adsense ad code at any desired location on your website.You just need to determine where you want to show the ad on your website.
You can do simple ad management on your website with/without the help of any plugin.In this article, I will pictorially show you how to add Adsense to your WordPress Site directly without the need of a plugin.
How-to Add Adsense Code to Your WordPress Site: Beginners Step-by-step Guide
Adding Ads is quick and easy in WordPress. Once you’re done with the Adsense Ad unit creation, Google displays the HTML code for the ads.All you have to do is copy and paste this code into the HTML code for your web page.
But before we start, In case if you want to center the ads in your webpage, you need to modify your Adsense code.Otherwise you can use the code straightaway.Try any one of these two ways to center your ad block.
1) <center> your Adsense code here </center>
2) <div style=”text-align: center;”> your google Adsense code here </div>
Most commonly ads are placed in the sidebars, header, footer and in the blog posts.
This post will show you exactly how to place your ad code in WordPress. Depending on where you want to place your ads, follow the below steps accordingly.
Firstly, Login to your WordPress Dashboard.
How to Add Adsense to WordPress Sidebar
Step 1: Go to ‘Appearance’ Section and click on ‘Widgets’.
Step 2: Next drag & drop the “Text/HTML” widget into the ‘Sidebar’ widget and paste the Adsense code.
You can add Adsense ad code into your blog posts manually in two ways:
Firstly, through your WordPress Editor;
Step 1: Go to ‘Appearance’ Section, click on ‘Editor’ and look for “Content-single.php” file.
Step 2: Open the ‘Content-single.php‘ file, click edit and paste the Adsense code into the file as per your choice of ad placement.
Note:For the Adsense Ads to appear immediately below the Blog post title, you need to add Adsense code, after <h1 class=”entry -title”><?php the_title( );?></h1> i.e just before the <! – – .entry-header – -></header> in ‘Content-single.php’ file as shown below.
In the similar manner, For the Adsense Ads to appear below the Blog post Content, you need to add Adsense code, towards the end after <! – – #post -<?php the_ID( ); ?> – -></article> in the same ‘Content-single.php’ file as shown below.
Note: With this feature, you can also choose to enter the number of days after which you want to show the Ad.
Step 4:Save Changes to complete the process.
Your website now displays the ad block at your desired locations, with ads relevant to the content on your webpage.In case if the ads don’t show-up, you need to wait a while for the ad unit to become active.
In addition to Google Adsense, this process is applicable to display any banner advertising . For better placement control, I recommend you to try ‘Google Adsense’ or ‘Simple Ads Manager’ WordPress plugin. With Google Adsense plugin you can manage only Adsense Ads.
I hope this article will help you place ads onto your WordPress site. Let me know what you are using to manage Adsense ads on your WordPress site by leaving a comment below.