How to make a widget sticky in WordPress

Last updated: 28 October 2026

A sticky widget stays in view while visitors scroll down a long page: a newsletter box, an ad, a table of contents in the sidebar. There are three ways to get one. On a theme that turns it on (block themes like Twenty Twenty-Five, and classic themes whose theme.json enables appearance tools, like Astra and Kadence), WordPress itself can make a Group block sticky. On any theme, a line of CSS can do it when the layout lets it. A plugin covers the rest: classic widgets, any block, stopping before the footer, and themes where CSS alone does not stick.

We make one of those plugins, Quicksloth Sticky Widget, so we are not neutral; this page says where you do not need it. Everything below was checked on WordPress 7.1.3 on 26 October 2026, with Twenty Twenty-Five (a block theme) and five classic themes: Astra, Kadence, GeneratePress, OceanWP and Twenty Twenty-One.

First: which kind of theme do you have?

In your dashboard, open the Appearance menu.

WordPress's own Sticky setting (themes that turn it on)

WordPress has a Position setting with a Sticky option. It is offered only for the Group block, and only when the theme turns it on: in its theme.json (appearanceTools, or position.sticky) or with add_theme_support( 'appearance-tools' ). In our test on 26 October 2026 it was on in Twenty Twenty-Five, Astra 4.14.1 and Kadence 1.5.2, and off in GeneratePress 3.6.1, OceanWP 4.2.7 and Twenty Twenty-One 2.9.

  1. Open the page, post, template or template part that holds the content to keep in view. For a sidebar on a block theme, that is usually under Appearance → Editor, in a template or template part.
  2. Put the content in a Group block, if it is not in one already, and select the Group.
  3. In the block sidebar on the right, open the Styles tab (the half-filled circle icon, next to the gear).
  4. In the Position panel, choose Sticky. If the panel shows no field, add it from the panel's options menu (the three dots). The editor then says that the block will stick to the top of the window, or, inside a column or another block, to the scrollable area of the parent block.
  5. Save, and check a long page while logged out (or with the admin bar in mind: WordPress moves the block down by the bar's height when you are logged in).

In our test, a Group block set this way inside the narrow column of a Columns block stayed at the top of the window while the long column next to it scrolled, on Twenty Twenty-Five, Astra and Kadence. What this setting does not do:

If those limits do not matter for your page, you do not need a plugin.

Classic themes: widgets have no Sticky option in WordPress

WordPress has no sticky setting for widgets. The widget form under Appearance → Widgets has the widget's own fields only, and the Group block's Position setting described above is offered only on themes that turn it on (Astra and Kadence do, GeneratePress, OceanWP and Twenty Twenty-One do not), with the same limits. That leaves three routes:

A line of CSS, and why it sometimes does not stick

On a classic theme you can add CSS under Appearance → Customize → Additional CSS. Most themes put the widget's ID on its outer box (look for id="text-2", id="block-3" and similar with your browser's "Inspect" tool). For a widget with the ID text-2:

#text-2 {
  position: sticky;
  top: 20px;
}

This is all a sticky element needs, but CSS position: sticky has two conditions that themes often break:

CSS also has no idea of a footer: the widget stops only where its parent ends. When one of these gets in the way, a plugin has to measure the page with JavaScript instead. To find which condition your theme breaks, and the CSS fix for each, see sticky sidebar not working in WordPress; for Astra, GeneratePress, Kadence and OceanWP, see what each theme offers and the CSS that works.

When a plugin is worth it

WordPress's Sticky settingCSS by handQuicksloth Sticky Widget
ThemesThemes that turn it on (Twenty Twenty-Five, Astra, Kadence; not GeneratePress, OceanWP or Twenty Twenty-One, checked on 26 October 2026)Any, if the layout allows itBlock and classic themes
What can be stickyGroup blocksAnything you can selectClassic widgets (a tick), any block (a switch), anything by CSS selector
Gap from the top0 pxYour top valueMargin top, 10 px by default
Stops before the footerNo, only at the end of its parentNo, only at the end of its parentYes, before the theme footer and any Stop elements you list
Parent with overflow or a short sidebarDoes not stickDoes not stickFalls back to a fixed position with a placeholder
Off on small screensNo settingWith a media queryMinimum screen width and height, Devices
JavaScriptNoneNoneOne script of about 5 KB compressed, only on pages with a sticky element

With Quicksloth Sticky Widget

The plugin is free in the WordPress.org Plugin Directory.

  1. In your dashboard go to Plugins → Add Plugin, search for "Quicksloth Sticky Widget", click Install Now, then Activate.
  2. Classic widget: under Appearance → Widgets, open the widget and tick Sticky (stays in view while scrolling), then save.
  3. Block, in a post, a template or the widgets editor: select it and turn on Sticky in its Sticky panel (in the block sidebar, under the gear). On a block theme without widget areas, do it in a template or template part under Appearance → Editor.
  4. Optional: the gap, the stop elements and the screen sizes under Appearance → Sticky Widget. With a caching plugin, clear its cache after saving.

The plugin uses position: sticky where the theme allows it and a fixed position only where it does not. It sends nothing to other servers and sets no cookies. More on what it does and what it does not do; for a table of contents in the sidebar, see sticky table of contents in WordPress; if you use Fixed Widget (q2w3) today, the Fixed Widget alternative page shows how its settings are imported. Questions about your theme: support@quicksloth.dev.