Insert ads within your Post Content in WordPress without plugins

Posted by on

I don’t like to install plugins for small issues like inserting ads within your WordPress post content. Installing plugins for little things may effect your website’s speed. Lesser the plugins = faster the speed. You can use maximum 15-20 WordPress plugin for an average site speed.

Read this: Must use WordPress plugins

Placing the ads in start and end points of your post is, however, legal, but putting it in the middle of your content is unfair according to the ads placement policies by Adsense. I’ve seen many blogs getting permanently banned due to the improper installation of  Google AdSense ads. I don’t want you all to make the same mistake. You can also place ads in the sidebar, footer, header and gain a good amount of impressions.

Read this: How to Add Google AdSense to Your WordPress WebSite

Following the Google Adsense rules is a must, and you’ll also get various ads placement ideas on the official Google AdSense page and obtain a high quality of earning by following these rules.

For WordPress, there are many ad management plugins which offer the ad placement between the posts. But rather than installing plugins you can manually place ads in your posts. Let us see how.

The Google ads code just looks like the one given above. This code contains the Javascript which helps Google to change ads according to your content and also according to time. Now placing this code in the right place will give you a good number of impressions and also CPC. So let’s check out these three easy steps to put ads post content without plugins on WordPress.

Read this: 6 Best Google Adsense plugins for WordPress


Login to your Adsense account. Copy the right ad code from your Adsense account ( Choose the ads according to your page size ).  Adsense has a huge variety of different ad sizes and codes. You can choose any one of them which suits bet on your site. Also, you can choose what category of ads you would like to display on your website. Adsense will provide you with the best ads according to your desired type)

Read this: How to insert Google AdSense Ads in WordPress Sidebar


Done copying the right ad code. Now login to your WordPress dashboard and go under the Appearance > Editor. You will see you Stylesheet CSS file over there and the huge bunch of files on the right side of your editor page. Now click on file named single post or single.php. This file contains a large number of classes and divisions. This file contains the elements of your every post. As you have your ad code copied to the clipboard just paste it above and below this code.

Your code might be different, but you will find one with the prefix or suffix named “content”. The code above holds the content of your website. If you’ve found one just paste your code above and below it. You can also choose the different ad for displaying below the content from Google Adsense dashboard. You can also keep both the ads same. It depends on you. But I will recommend you to place different ads on both the locations, as Google pays differently for different ads. The resultant code must look like this.


Done pasting it on the desired places? Hit the “Update file” button below the container to let it take effect. Now visit any post on your site, and you will see that there is one ad above the post content, and the one is below it. Place ads display content without plugins

Hence, there are many WordPress tips and tricks which can save your time and space too. Installing the plugin and placing ads is easy, but what if those plugins increases your HTTP request and make your site slow? So as a Blogger, always choose a way which is helpful from all point of view. As we are publishers, AdSense allows us to post ads in the correct place. But for that, it has some important rules which should be followed. Otherwise, it will lead to the permanent deletion of your AdSense account. The rules are as follows.

  • Any ad publisher should not modify their ads (ad codes)
  • Any ad publisher should not encourage their visitors to click on their ads via offer banners or animations.
  • The publisher must be aware of the Ad placement policy by Adsense.
  • The publisher should not use the techniques of implementing AdSense ad code in a way that covers content or where material includes ads.
  • The publisher should avoid the on click scripting of Google ads.
  • One should use any code or script to display more than three Google AdSense ads on a page.

You can also watch this video for a detailed explanation of ad placement policy by Google Adsense.



place ads post content without plugins WordPress

Share This Post

Last updated: March 2, 2017

Authored by :

I'm 3nions's co-founder and an individual contributor to the team. Besides being a Web Enthusiast, I like writing on SEO & Marketing. Also, I'm a Co-founder and Managing Director of illustrake.


Robin Khokhar

Hi Prakhar,
Firstly thanks for the recent visit to my blog. And I must say that this topic of your is really good. I was thinking that how could we do it without plugins.
So, thanks for sharing this amazing post.

Thanks for the interaction bro and I’m really glad that you liked this post. Installing too many plugins may slow down your website and hence it is my recommendation to the WordPress users to follow this technique 🙂

Hey bro, Really nice stuff. but I don’t recommend to the newbie to try it out as it can be dangerous to their blogs. I have tried editing many times. Sometimes it went worst. I have encountered frequent variations in the code of different themes. Not all the themes follow the same coding pattern.

What you say about my point of view bro..


Hey Nikhil,
Nice to see you here, and I’m really thankful that you liked it. This tutorial is not recommended for newbies or those who do not have the proper coding knowledge. And from the theme point of view, it is basically applicable on most of the (simple) WordPress themes. There are many premium (complex) WordPress theme out there in which the code editing is a really hard stuff, this article is of no use for HQ WordPress themes. I wrote this tutorial mainly for the bloggers, and for better SEO, a Blogger should use simple WordPress theme.

Hello Prakhar,

I am a blogger and founder of updatepedia blog. can you please let me what plugin do i use for adsense, rightnow i am using quick adsense plugin. i have a huge traffic in my blog, but don’ t what where should i place in content? and what size? please help me guide on placement? which one is better plugin or manual coding for showing ads in content?

Hey @aamir,
I’ve just flashed on your blog and its a cool stuff. For manual coding, you should have little understandings in the HTML and PHP. You can use insert post ads plugin for inserting ads in your posts page. You can easily configure and use it and it will be better for your blog rather than a manual code.

Ravi sharma

Amazing article.I really appreciate your work.Keep it up

Hi Prakhar,

Nice article, very useful for those who don’t want to use a plugin for ads. but I must say interesting. Thanks for sharing.


Glad you liked it, Arpit. Keep visiting ☺

thanks for sharing.. i try

Thanks for sharing this information on your blog. I followed the mentioned steps to add Google Adsense ads on my blog. Thanks once again to sharing this information with us.

Nice and useful guide . Very informative . Thanks for sharing this information .

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.