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

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:

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:

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:

  1. 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.
  2. Under Appearance → Sticky Widget, in Devices, untick Tablet and Phone and keep Desktop. These boxes apply to every sticky element on the site.
  3. 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.
  4. With a caching plugin, clear its cache after saving.

What we saw in the test page:

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 ruleWhat to doFree plugin
300 px wide or narrowerUse a 300×600, 300×250, 160×600 or 120×600 unitNot checked: your choice
No overlap, not too closeAd in the last widget; margins from header and footerMargin top, Margin bottom, stop before the footer
One sticky ad in viewMake only one ad stickyStacks every ticked element: tick one ad
Desktop only@media (min-width: 1025px) or higherDevices: Desktop only
Never appears mid-scrollKeep the ad in the page from the startDoes not hide or show elements
No refresh without the userNo auto-refresh scripts on AdSenseDoes 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.