Sticky sidebar ads in WordPress: what AdSense allows
Last updated: 1 November 2026
An ad that stays in view while the reader scrolls a long post is one of the most common reasons to make a sidebar widget sticky. AdSense allows it, with conditions. This guide lists Google's conditions, explains why sites on Mediavine, Raptive or Ezoic should not do it themselves, and shows how to set it up on an AdSense site with CSS, with WordPress's own Sticky setting or with a plugin.
We make a sticky widget plugin, Quicksloth Sticky Widget, so we are not neutral; most of what follows needs no plugin. We are not affiliated with Google, Mediavine, Raptive or Ezoic. Google's rules were read on 1 November 2026 and can change: check Google's page before you rely on them. Only Google decides what is allowed on your AdSense account, and we make no claim that a sticky ad will earn more on your site. The behavior below was checked the same day in a small test page in Chromium 153, with a grey 300×600 box in place of a real ad, and with our plugin's script (version 1.0.1).
Short version
- AdSense allows sticky ads on desktop only, 300 px wide or narrower, one in view at a time, never covering or touching other content.
- Put the ad in the last widget of the sidebar, so it has nothing below it to cover.
- On Mediavine, Raptive or Ezoic, their own script makes the sidebar ad sticky: do not make it sticky again, and do not add other sticky widgets around it.
- With CSS, wrap the rule in
@media (min-width: 1025px); with our plugin, untick Tablet and Phone and mark only one ad as sticky.
1. What Google's page says
The rules are in the AdSense Help Center, Ad formats FAQ, under "Sticky ads", which starts with "Sticky ads are permitted in AdSense". In short, the page sets these technical requirements:
- Width: only ad formats 300 px wide or narrower. It lists 160×600, 300×600, 300×250, 300×50 and 120×600 as allowed and 728×90 as not allowed.
- No overlap: the ad "must not overlap or underlap any other page content", and must never come too close to content, to navigation (scrollbars included) or to another ad, also when the window is resized.
- Always complete: the ad attribution and all of the ad's content are shown at all times.
- No appearing: the ad scrolls into and out of view like the rest of the page; it cannot appear or disappear at some point in the scroll.
- Vertical only: no horizontal movement, no floating elsewhere on the page, no following the cursor; it must render and scroll smoothly.
- One at a time: "There can only be one sticky ad visible in the viewport at a time". No mirrored sticky units on both sides of the content, and no two units side by side.
- Desktop only: ads "should not be sticky on tablet or mobile optimized versions of a site", and the setup must stay within the rules on tablets and phones even if the page is not optimized for them.
Two related points. The AdSense ad placement policies do not allow refreshing a page or an element of it without the user asking for a refresh, so do not add a script that refreshes the sticky ad. And Google has a separate page of sticky ad guidelines for Ad Manager: that one is for Ad Manager and Ad Exchange, not for AdSense, so do not mix the two.
2. On Mediavine, Raptive or Ezoic: leave it to their script
Ad management networks place the sidebar ads with their own script and make one of them sticky, by default or, on Ezoic, when you turn it on. Their help pages, read on 1 November 2026, say:
- Mediavine: “You have two ads in your sidebar - one with a more flexible placement, and one with a fixed, ‘sticky’ placement” (The Sidebar Ad), and “The sticky sidebar ad MUST be the last thing in your sidebar. It's not allowed to scroll over other content, or other ads, per ad exchange rules.” (Sticky Sidebar Ad Unit Health).
- Raptive: “The sticky sidebar ad is an ad at the bottom of your sidebar that ‘sticks’ to the top of the screen and scrolls with the reader.” (Know Your Ads: Raptive Ad Placements).
- Ezoic: sticky sidebar ads are turned on in the Ezoic dashboard, with a “Sidebar Floating” placeholder, and the page asks to “Ensure there is no content or other placeholders in the sidebar below this placeholder before saving.” (article “What is a Sticky Sidebar ad? How can I add a Sticky Sidebar ad to my site?” in the Ezoic knowledge base).
So if your site is on one of these networks, do not mark their ad unit, or the widget that holds it, as sticky with CSS or with any plugin, ours included: it would be a second script moving the same box. A second sticky widget in the same sidebar is also risky, because two boxes that stay in view in one column can end up over each other or over the ad. We have not tested our plugin together with these networks' scripts. If you want something else in view, such as a table of contents, ask the network first; Mediavine's page notes that changes to the sidebar often mean they re-target the ads.
The rest of this page is for sites that place AdSense code themselves, usually in a Custom HTML widget, with no network script.
3. The ad has to be the last widget
A sticky box is drawn above the ordinary boxes around it. In our test page, with the ad as the first widget and a 400 px newsletter widget below it, the sticky ad stayed 20 px from the top and, after 500 px of scrolling, covered 380 px of the newsletter widget. Our plugin did the same in that position. That is exactly the overlap Google's page rules out.
As the last widget, the ad has only empty column below it. In the same page it stayed in view and stopped where the sidebar column ended, 60 px above the footer, without covering anything. Put the ad widget at the end of the sidebar under Appearance → Widgets (classic themes) before you make it sticky.
4. With CSS, desktop only
Find the ID of the widget that holds the ad: right-click the ad's area, choose Inspect, and look for the box around it with an ID such as custom_html-3 or block-3 (the number changes from site to site). Then add the rule under Appearance → Customize → Additional CSS, inside a media query so it applies only to wide windows:
@media (min-width: 1025px) {
#custom_html-3 {
position: sticky;
top: 20px;
}
}
In our test page the widget was sticky at 1280 and 1025 px and stayed in its place at 1024 px. The 1025 px threshold is a choice, not Google's: it matches the desktop width our plugin uses (below). A window width cannot tell a laptop from a large tablet held sideways, so if many of your readers use big tablets, a higher threshold is the cautious option, at the cost of small laptops. With a fixed header, set top to the header height plus a gap, so the ad never touches the header.
If nothing sticks, the theme breaks one of the conditions CSS sticky needs, most often an overflow rule on a parent or a sidebar no taller than its widgets: see sticky sidebar not working in WordPress for how to find each cause and fix it.
5. Block themes: WordPress's own Sticky setting
On a block theme, WordPress offers Position → Sticky in the Styles tab of the Group block, but only on themes that turn it on. In our tests with WordPress 7.1.3 it worked on Twenty Twenty-Five, Astra and Kadence, also for a Group inside a column, and was missing on GeneratePress, OceanWP and Twenty Twenty-One. For ads it has two limits: the Group sticks at 0 px from the top of the window, with no field for a gap, so with a fixed header it would slide under it, which Google's page rules out; and the setting has no device option. We have not tested how it behaves on a phone, where columns usually stack; to keep it to desktop you would still need custom CSS like the rule above. Details in our guide to making a widget sticky.
6. With Quicksloth Sticky Widget
A plugin helps when CSS sticky fails on your theme, or when you want the ad to stop before the footer rather than at the end of its column. With the free plugin:
- Under Appearance → Widgets, open the widget with the ad code (the last one in the sidebar) and tick Sticky (stays in view while scrolling). Do not tick it on a second ad widget. In the block widgets editor, or on a block theme under Appearance → Editor, select the block and turn on Sticky in its Sticky panel instead.
- Under Appearance → Sticky Widget, in Devices, untick Tablet and Phone and keep Desktop. These boxes apply to every sticky element on the site.
- With a fixed header, set Margin top to its height plus a gap. Give Margin bottom a value too, so the ad stops short of the footer instead of touching it.
- With a caching plugin, clear its cache after saving.
What we saw in the test page:
- With only Desktop ticked, the ad was sticky at 1280 and 1025 px and stayed in place at 1024, 800 and 375 px. The plugin goes by window width only: phone under 768 px, tablet from 768 to 1024 px, desktop above. Like the CSS rule, it cannot recognize a large tablet held sideways; raise Minimum screen width if you want to be stricter.
- An ad box that was empty when the page loaded and filled in 2.5 seconds later was still picked up: it stuck 10 px from the top (the default Margin top) and stopped at the end of the column.
- With an 80 px fixed header and Margin top set to 100, the ad stayed at 100 px.
- With
overflow-x: hiddenon a page wrapper, where CSS sticky fails, the plugin switched to its fixed-position fallback, with a placeholder that keeps the column from jumping; at the end of the page the footer pushed the ad up. With Margin bottom at 0 the ad's bottom edge touched the footer; at 20 it stopped 20 px above it, which is why step 3 asks for a value. - With two ad widgets ticked as sticky, the plugin stacked them one under the other and both stayed in view: that breaks Google's one-at-a-time rule, and the plugin does not stop you from doing it.
The free plugin does not know which element is an ad. It does not check the 300 px width, it does not refresh ads, and the distances from content and navigation depend on your layout and margins. It makes the positioning easier; it does not make a layout comply by itself. It is free in the WordPress.org Plugin Directory.
A separate Pro add-on is planned and not available yet. Its draft has an ads mode built from Google's page (desktop only, 300 px or narrower, one sticky ad at a time, never appearing in the middle of a scroll) and a reserved height, so the space for an ad that loads late stays empty instead of making the page jump. The plugin page will say when it is available.
Quick check list
| Google's rule | What to do | Free plugin |
|---|---|---|
| 300 px wide or narrower | Use a 300×600, 300×250, 160×600 or 120×600 unit | Not checked: your choice |
| No overlap, not too close | Ad in the last widget; margins from header and footer | Margin top, Margin bottom, stop before the footer |
| One sticky ad in view | Make only one ad sticky | Stacks every ticked element: tick one ad |
| Desktop only | @media (min-width: 1025px) or higher | Devices: Desktop only |
| Never appears mid-scroll | Keep the ad in the page from the start | Does not hide or show elements |
| No refresh without the user | No auto-refresh scripts on AdSense | Does not refresh ads |
More on what our plugin does and does not do, how to make any widget sticky and why a sticky sidebar sometimes does not work; if you use Fixed Widget (q2w3) today, see the Fixed Widget alternative page. Questions about your theme? Write to support@quicksloth.dev with a link to the page. We cannot answer questions about your AdSense account: those go to Google.
Google's rules and the networks' help pages read on 1 November 2026; behavior tested the same day as described at the top. Written with AI tools and checked by Quicksloth.