Manually Display or Insert Adsense Ads inside WordPress Posts | 9to5Blogger

Trending: BlueHost Review | RSS Feed Scraping | Responsive Adsense Ads | Adsense Alternative | Blog Commenting Sites | Alexa Ranking | Adsense on ET Blogs | File DMCA
Popular: Duplicate Content | Timeless Blogging Niches | Niche Blogging | EMD Penalty | Blog w/o Writing Skills | WordPress Security | Bye Bye Job | Successful Tech Blog | Blogger2WP

How to Display/Insert Adsense Ads inside WordPress Posts?

BlueHost Discount Coupon

If you’re an Adsense publisher, you might’ve known the importance of CPC (cost per click) and CTR (click through rate). One should improve the performance of CPC and CTR if he wants to earn high from Google Adsense. Generally, webmasters try to place the advertisements at the beginning of the article (under the title) to get more clicks. But, this tactic won’t work in all the cases. Placing ads inside the article also has the highest click rate and so if you could insert your Adsense ads within your WordPress post, then CTR will eventually increase as there will be more chances for getting content-related ads.

How to Insert or Add Adsense Ads within the Post in WordPress Manually?

This is very simple. By creating a shortcode in the functions.php file, you can achieve this.

  1. Login to your WordPress dashboard > go to Appearance > Editor.
  2. Click on the “functions.php” file from the right side panel.
  3. Copy and paste the following code in your functions.php file at the end.

    function adsense1() {
    return ‘
    <!– Start Here –>
    Paste Your Adsense Code Here
    <!– End Here –>
    ‘;
    }
    add_shortcode(‘adsense’, ‘adsense1′);

  4. Replace the lines in red color with your Google Adsense ad script that you wish to appear inside your WordPress post and click save.
  5. Starting now, whenever you compose a new post, simply go to “HTML mode” in the editor and type [adsense] at the point where you wish to display this Adsense ad and click “Publish”.Adsense Ads inside WordPress Posts
  6. You can even add styles to your displayed advertisement.
    • Go to Appearance > Editor and open style.css file.
    • Add the following code at the end and click save.

      .adstyle {
      background:#f4f4f4;
      width:400px;
      height:500px;
      text-align:right;
      float:right;
      border:solid 1px #c7c7c7;
      }

    • This is a sample code and you can modify it as per your blog colors.

Note: If you’re adding style to your ads, then don’t forget to use <div class=”adstyle”>[adsense]</div> instead of [adsense] in the step 5.

This is a handy shortcode method to insert advertisements or banners within your post content. Not just Adsense ads, you can follow this guide to add any code inside your posts.

Note: Although, there are plugins to add Adsense ads inside WordPress posts, I personally prefer adding them manually as plugins will increase the load time of our blog.

Incoming search terms:

  • adsense show in recent posts wordpress
  • how put adsense end post wordpress
  • how to place adsense ads on wordpress just at end of the post
  • insert ads right wordpress post
  • insert adsense comment post <!-- adsense --> wordpress
WPEngine Discount CodeElegant Themes Discount Earn Money Writing Article Spinner Software

Tags:

Posted by on October 18th, 2012 under Wordpress Category 3 Comments
 

Share This Article

Get Free Email Alerts

Stay Updated with Useful Blogging Tips. Get Free Email Newsletter Updates..

And, Next Confirm Your Email Subcription

   

3 Comments to “How to Display/Insert Adsense Ads inside WordPress Posts?”

  1. Narender says:

    You said right Radha Bro Plugins are good to use but makes your blog slow.But your Tut is so easy that I don’t think one will use any plugin for that purpose :)
    Narender recently posted..Should You Make Blogging Your Career ?My Profile

  2. Dencia says:

    I actually use plugin. It saves time though it might slow your website down but it is hardly noticeable.
    Dencia recently posted..Unilever Nigeria Plc VacanciesMy Profile

  3. Good Post, Thanks for It!

Leave your comment here:


5 × nine =

CommentLuv badge
 
Get Regular Blogging Updates
Facebook Twitter Google Plus RSS Feed Email
Useful Blogging Resources
WordPress Hosting Content Delivery Network