How to Add Skycraper AdSense & DFP Ads in WordPress without Plugin + Auto Refresh?

Hey hi are there any good free plugins for adding an advertisement below the header and to add sticky skycrapper ads on both left and right sides

Sorry, there is no such plugin. Since, such placement generally depends on the theme available feature.

  • Check theme settings > AdSense placement options
  • Ask theme Developer at their official support forum/contact channel.


You’re welcome!

You can create a custom PHP script for loading advertisements.
Then paste the script wherever necessary.

Skycrapper ads are great to increase the impression of your Ads for Desktop devices and also they have a higher chance to get clicked by users.
Here is the code which can help you to add Skycrapper ads for both left & right side. Thanks to @piyush for the media only query help.

<!-- /123456789/Your_Ad_Slot_Name_and_Channel-->
<div id='div-gpt-ad-123456789-0' style='width: 120px; height: 600px;'>
    googletag.cmd.push(function() { googletag.display('div-gpt-ad-123456789-0'); });
<div id='div-gpt-ad-123456789-1' style='width: 120px; height: 600px;'>
    googletag.cmd.push(function() { googletag.display('div-gpt-ad-123456789-0'); });
{display: block; position: fixed; top: 80px; width: 120px; height: 600px; right: 0px;}
{display: block; position: fixed; top: 80px; width: 120px; height: 600px; left: 0px;}
@media only screen and (max-width: 1024px){
#div-gpt-ad-123456789-0, #div-gpt-ad-123456789-1 {display: none;}}</style>


Disclaimer: Image is just for education purpose only.

This code is made with DFP Ad unit code (with fixed height of 600px and width of 120px) but you can use it with AdSense by doing some minor changes. You can also change the height and width as per your best view.

But here is a problem, which is how to make it auto refreshable in every 10 second interval?
(Note: I’m using the default div id of DFP units to control the ads size & positions)

You can’t. It’s against AdSense policy to refresh ads automatically unless they are user-initiated.


If you still want to use auto-refresh ads I’ll recommend checking out NitroPay and Newor Media. Both offer access to Google AdX inventory along with header bidding and auto-refresh ads.

Hey @aatishrkamble Already knew about that. But if you have higher traffic than I don’t think Google can trace it by using bots. So, is there any way to refresh ads as I have mentioned above.
And by the way, I use this with DFP ads code not directly with AdSense. And regarding DFP partners like, Ezoic, Nitropay etc, I an unaware about their working process. WHy they are doing it for free or I will have to pay at the end? I still don’t have any idea about it.

They have a kind of revenue model, and upsell plan as well.

High volume traffic will not mask your policy violations. AdSense can easily flag your website if they notice a pattern of multiple ad requests in a small amount of period from every user. Why risk your account for small gains?

NitroPay works on a rev share model. They take 20% of your final earnings, no upfront payments.

Ezoic works on a hybrid model where they offer some premiums service for a fee. But they also have a 10% rev share model with no upfront payment, you can find it on their pricing page.

1 Like

Without using any 3rd party there should be a way to do that with coding?

AdSense doesn’t allow sticky advt. Therefore it means even if there is a way it wont be allowed.

Suppose If I put there sponsored ads by 3rd party, then ?

Yes, you can. There is no problem with 3rd-party advt.

But how to auto-refresh it?

Modification of this code?

AdSense will ban account this way.

Why you don’t understand that I don’t want to put AdSense ads as sticky but still I need use this same CSS code to sticky any 3rd part ads?
So, how to modify it for 3rd part ads for auto refresh?

Create a HTML file with name auto-refresh-advt.html and put below code.

<!doctype html>
<!-- refresh auto-refresh-advt.html every 5 seconds -->
<meta http-equiv="refresh" content="5;URL=" />
<!-- Ad code start -->

... put your ad code here ..

<!-- Ad code end -->

Place below code in Theme widget where you need to display

<iframe src="" height="600" width="300" scroll="no"></iframe>

I have already seen this but this is not what I want.