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.
- If it shows Editor, you have a block theme (Twenty Twenty-Five, for example). Sidebars are blocks inside templates, edited in the site editor. Read the next section.
- If it shows Widgets and Customize, you have a classic theme (GeneratePress, Astra, Kadence, OceanWP, Twenty Twenty-One, for example). Sidebars are widget areas filled under Appearance → Widgets. Some classic themes (Astra and Kadence among them) also turn on the Sticky setting of the next section for Group blocks in posts and pages; for widgets, see classic themes.
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.
- 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.
- Put the content in a Group block, if it is not in one already, and select the Group.
- In the block sidebar on the right, open the Styles tab (the half-filled circle icon, next to the gear).
- 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.
- 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:
- It works on the Group block only. To make another block sticky, wrap it in a Group.
- The block sticks to the very top of the window (0 px): there is no field for a gap.
- It never stops early. The block moves on only when the end of its parent block (the column, say) reaches it, so a tall sticky box can slide over content below if the parent is longer than you expect.
- It does nothing on themes that do not turn it on. On GeneratePress, OceanWP and Twenty Twenty-One, a Group block carrying the same setting was shown as a normal, non-sticky block.
- It is CSS
position: sticky, so it stops working if a parent element hasoverflowset tohiddenorauto, which some themes and page builders do (see why CSS sometimes does not stick).
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:
- Your theme's own option. Some themes have a sticky sidebar setting. Check the theme's settings and documentation first: it costs nothing and knows the theme's layout.
- A line of CSS, below, when the layout allows it.
- A plugin that adds a Sticky tick to widgets, like the one at the end of this page.
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:
- The sidebar must be taller than the widget. A sticky element only moves inside its parent. If the theme's sidebar column ends where its last widget ends, there is no room to move and nothing happens.
- No parent may clip its content. If any element around the widget has
overflow: hidden,overflow: autooroverflow: scroll, the widget sticks to that element instead of the window, which usually means not at all.
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 setting | CSS by hand | Quicksloth Sticky Widget | |
|---|---|---|---|
| Themes | Themes 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 it | Block and classic themes |
| What can be sticky | Group blocks | Anything you can select | Classic widgets (a tick), any block (a switch), anything by CSS selector |
| Gap from the top | 0 px | Your top value | Margin top, 10 px by default |
| Stops before the footer | No, only at the end of its parent | No, only at the end of its parent | Yes, before the theme footer and any Stop elements you list |
Parent with overflow or a short sidebar | Does not stick | Does not stick | Falls back to a fixed position with a placeholder |
| Off on small screens | No setting | With a media query | Minimum screen width and height, Devices |
| JavaScript | None | None | One 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.
- In your dashboard go to Plugins → Add Plugin, search for "Quicksloth Sticky Widget", click Install Now, then Activate.
- Classic widget: under Appearance → Widgets, open the widget and tick Sticky (stays in view while scrolling), then save.
- 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.
- 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.