How to place ads in post content without plugin : WordPress

Posted by on

Share this

place ads post content without plugins

I don’t like to install plugins for small issues like place ads in post content. So I get into the post layout and enter some useful strings to display ads in my post. Installing plugins for small things may effect your website’s speed. Lesser the plugins = faster the speed. You can use maximum 15-20 WordPress plugin for an average speed. I mainly use the recommended plugins like Akismet, Jetpack and some more.

When you’ll see my post you’ll come to know that there are two ads in my post, one in the beginning and one in the end. Placing the ads in start and end points of your post is however legal, but placing 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 unfair placement of  Google adsense ads. I don’t want you all to make the same mistake. You can also place ads in sidebar, footer, header for quality impressions. Putting ads in middle of the content considered as an  unnatural attention to ads by Google.

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 good quality of earning by following these rules.



Icons made by Freepik from is licensed by CC 3.0 BY


For WordPress there are many ad management plugins which offers the ad placement between the posts. But rather than installing plugins you can manually place ads in your posts. Lets 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 good number of impressions and also CPC. So lets check out these three easy steps to place ads post content without plugins on WordPress.




Login into 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 you website. Adsense will definitely provide you the best ads according to your desired category)


Done copying the right ad code. Now login into your WordPress dashboard and go under the Appearance > Editor. You will see you Stylesheet css file over there and huge bunch of files on the right side of your editor page. Now click on the file named single post or single.php. This file contains the large number of classes and divisions. This file actually contains the elements of your every post. As you have your ad code copied on 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 find one just paste your code above and below it. You can also choose 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 places, as google pays different for different ads. The resultant code must look like this..


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

Also read: How to verify site ownership on Google Search console

Hence, there are many WordPress tips and tricks which can save your time and space too. Installing 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 a we are publishers, adsense allows us to post ads in the correct place. But for that it have some important rules which should be followed otherwise it will led to 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.
  • Publisher must be aware of the Ad placement policy by Adsense.
  • Publisher should not use the techniques of implementing AdSense ad code in a way that covers content or where content covers ads.
  • Publisher should avoid the on click scripting of Google ads.
  • One should using any code or script to display more than 3 google adsense ads on a page.

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


Also read:


place ads post content without plugins WordPress

place ads post content without plugins WordPress

Last updated: April 8, 2016

Authored by :

Hi ! I'm Prakhar Shrivastav, currently a final year BSc student and a co-founder of 3nions. I love spending quality times on Web development, Graphic designing, and SEO.


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 ☺

Leave a Reply