What is a Sticky Header/Footer?
A sticky header stays pinned to the top of the screen as a visitor scrolls down the page. A sticky footer stays at the bottom of the viewport, the visible screen area, when a page’s main content is too short to fill it; longer content pushes the footer down as normal.
More About Sticky Headers/Footers
A sticky header keeps your navigation menu in reach, so visitors can jump to another page without scrolling back to the top. On long pages, that helps your site's user experience (UX). Sticky footers need more care, because people use the phrase for 2 different patterns.
Sticky header vs. sticky footer
A sticky header is pinned: it stays at the top of the screen the whole time a visitor scrolls. A classic sticky footer is not pinned. It's a layout pattern that holds a short page's footer at the bottom of the viewport, the visible screen area, instead of letting it float up mid-screen. On pages longer than the viewport, the footer sits below the content as usual, and visitors scroll to reach it.

A footer that stays on screen while visitors scroll is a fixed footer, a different pattern. Use the layout-style sticky footer to keep short pages looking finished, and a fixed footer when links or buttons must stay in reach at all times.
Position: sticky vs. position: fixed
CSS gives you 2 ways to pin an element, and the difference decides whether you need workarounds:
- position: sticky; top: 0; keeps the header in the normal page flow and pins it only once scrolling reaches it. The page still reserves its space, so nothing hides behind it and no padding fix is needed.
- position: fixed; removes the element from the page flow and pins it to the viewport at all times. It needs an offset to know where to sit, top: 0 for a header or bottom: 0 for a footer, and you'll have to pad the page body so content doesn't slide underneath.
Prefer position: sticky for headers, and reach for fixed only when an element must stay pinned no matter what, like an always-visible footer bar. The classic sticky footer uses neither: give the page wrapper min-height: 100vh, make it a flexbox column, and let the main content grow with flex: 1. The footer then lands at the viewport bottom on short pages by itself.
How to add a sticky header in WordPress
Check your theme's settings first; if there's a built-in sticky header toggle, use it. On a block theme you don't need a plugin: open the Site Editor, wrap the Header template part in a Group block, and set Position to Sticky. WordPress has offered this control since version 6.2 (March 29, 2023), and it writes the position: sticky, top: 0, and z-index rules for you.
On a classic theme without that option, a plugin can add one, and if you build with a page builder or a hosted website builder, look for a sticky header setting in its header options. For click-by-click instructions, read our guide Sticky Header in WordPress: 3 Simple Ways to Create One.
Sticky header trade-offs
A pinned header has a permanent cost: whatever height it takes is subtracted from every screenful of content, and the loss hurts most on phones, where the viewport is smallest. Keep a sticky header short, and consider unpinning it on small screens.
Pinned elements also need a little planning. They can cover the target of an in-page anchor link when the browser jumps to it; the CSS scroll-padding-top property exists for exactly this, reserving room at the top of the view for content a pinned bar would hide. And because a pinned bar overlaps whatever scrolls beneath it, it needs a z-index that keeps it on top. WordPress's built-in control sets one automatically.
The decision rule: use a sticky header on long pages where visitors actually need the menu mid-scroll. If nobody uses your navigation after the first screen, a normal header costs nothing.
Frequently Asked Questions
- WordPress's built-in Position: Sticky control pins a Group block to the top (it outputs top: 0), so it won't create a sticky footer. Use CSS instead: position: fixed; bottom: 0 for an always-visible bar, a flexbox page wrapper for the layout-style footer, or a theme or plugin option.
- Your theme must opt in, via the appearanceTools setting or settings.position.sticky in theme.json. When WordPress 6.2 introduced the control, it appeared only on Group blocks at the root of a template, so wrap your header in a top-level Group block first.
- Yes. MDN marks the CSS position property Baseline Widely available, meaning well established across browsers and devices. You don't need JavaScript or a plugin for basic pinning; the one thing position: sticky needs is an edge offset such as top: 0 so it knows where to stop.
- Yes, the techniques don't conflict: position: sticky; top: 0 on the header, and a flexbox wrapper or position: fixed; bottom: 0 on the footer. Just remember every pinned bar shrinks the space left for content, so keep both slim if you pin them together.
Powerful WordPress Hosting
Reliable, lightning-fast hosting solutions specifically optimized for WordPress. Find the perfect plan for you by clicking below.
WordPress Hosting Plans