Make your WP header sticky by asking

CMSHands, a free WordPress plugin, adds a chat to your dashboard. Ask it to keep your header on screen as people scroll. See it first; undo takes it off.

Works on block themes: you'll see Appearance › Editor in your dashboard. How to tell

Works on block themes: you'll see Appearance › Editor in your dashboard. How to tell

CMSHandsmysite.com

Works on sites hosted at

Watch it do this on a real site

You ask

1 of 5

Make my header stay at the top of the screen when people scroll.

Make my header stay at the top of the screen when people scroll.

  1. Looking at your themes
  2. Looking at your theme’s colours and sizes
  3. Reading your header
  4. Reading your header
  5. Reading a file on your site
  6. Reading a file on your site
  7. Reading one of your pages
  8. Looking something up in the database
  9. Preparing the new styles for your OK
  10. Previewing the change
Style Sticky header
Waiting for you
  1. /* CMSHands: Sticky header */
  2. .wp-block-template-part {
  3. position: sticky;
  4. top: 0;
  5. z-index: 100;
  6. }
  7. .wp-block-template-part:not(:first-child) {
  8. position: static;
  9. z-index: auto;
  10. }

Styling Sticky header

Add the stylesNot nowCan be undone

Ready for you to review. One caveat: these previews are scrolled past the header, so the sticking itself only shows once you scroll on the live page.

  1. Adding styles to your site
  2. Checking the change
Style Sticky headerApproved
Approved

Done. I checked afterwards, and the change is in place.

UndoCan be undone
The test site's home page scrolled down to the footer, with the header, the name and the menu, still at the top of the screen
  1. Reverting the change
  2. Checking the change

Undone. I checked afterwards, and it's back the way it was.

A real run on our test site, Quillmoor Pottery (WP 7.1.3, Twenty Twenty-Four), . From asking to done, it took 2 minutes 9 seconds.

  • Ask in your own words. It reads your theme and header, then writes CSS, the rules that set how your site looks.
  • Before anything changes, a card shows Now, After and the code, on a computer and on a phone.
  • Undo takes the styles off. In our run the header scrolled away with the page again.
More it does here (3)
  • It tells you the previews are scrolled past the header, so you check the sticking on your live page.
  • It adds styles only. Your header's words, menu and blocks stay as they are.
  • In our run the card came up about 115 seconds after asking. Adding the styles took about 5 seconds more.

Do this on your own site

That's the whole job. The plugin is free: 3 changes to try it, no account. Nothing changes until you press the button, and an undo within 24 hours gives the change back.

Download the free plugin

Get the plugin here instead

How to make your header sticky in WordPress yourself

In WordPress, open Appearance › Editor, wrap the header in a Group block, set its Position to Sticky, then press Save in each template.

Updated , checked on WP 7.1,

  1. 1. In your dashboard, go to Appearance › Editor. No Editor there? Your theme is an older one: see the note under these steps.

  2. 2. Click Templates, then a template your pages use, such as Pages. Click its preview to open it.

  3. 3. Open Document Overview, the icon of 3 lines at the top left, and click Header in the list.

  4. 4. In the toolbar above the header, click Options, the 3 dots, then Group. The header now sits inside a group.

  5. 5. With the group still selected, find Position in the sidebar on the right and choose Sticky.

  6. 6. Press Save at the top right. If WP lists the changes, press Save again.

  7. 7. Do the same in each template that shows your header, such as Single Posts. Then visit your site and scroll down.

No Editor, only Appearance › Customize? Then your theme is an older (classic) one. Look for a sticky or fixed header option in Customize or on the theme's own settings page. CMSHands can't add the CSS there itself yet. It can write it for you to paste into Appearance › Customize › Additional CSS.

WP also offers Sticky on the group inside your header part, but there it can scroll away with the page. The header part wraps that group, so it has no room to stay put. Set it on a group around the header part, as in step 4.

Or ask for it in the chat

“Make my header stay at the top of the screen when people scroll.”

Download the free plugin

Get the plugin here instead

Why it won't wreck your site

  • Nothing changes until you press the button. Every change comes as a card that names it. Nothing happens until you press the button or Not now.
  • You see it first. Old words in red, new words in green. For layout, before-and-after pictures on a computer and a phone.
  • One click undoes it. When something can't be undone, like deleting a page or a plugin, the card says so before you press.

What it won't do here

  • Older (classic) themesIt can't add CSS on a classic theme. It writes the CSS and tells you where to paste it: Appearance › Customize › Additional CSS.
  • Seeing it stick before you pressThe previews on the card are scrolled past the header, so they don't show the sticking. You see it on your live page, and undo takes it off.
  • A header that shrinks or hides as you scrollThat needs a script, and it can't add scripts yet. It keeps the header as it is, at the top.
  • Headers made with a page builderWe haven't tried it on a header made by Elementor, Divi or another page builder, so this page doesn't promise it. A page builder lays out pages its own way.

More it can do

Same chat, same OK button, on your own site.
  • Header and footer:

    Add a link to your menu

    “Add a "Workshops" link to my footer menu, pointing to the Workshops page.”

    It took 26 seconds on our test site.
  • Words and pages:

    Rename or add a blog category

    “Rename the blog category "News" to "Studio news" and add a new category "Glazes".”

    It took 15 seconds on our test site.
  • Words and pages:

    Copy a page

    “Make a copy of the About page as a draft called "About (new)".”

    It took 16 seconds on our test site.

Questions

What is a sticky header in WordPress?

It's a header that stays at the top of the screen while people scroll down. Your name and menu stay in reach on long pages. On a block theme, it's the Sticky choice under Position for a group block in the Site Editor.

How do I make my header sticky in WordPress?

On a block theme, put the header part inside a group in the Site Editor and set that group's Position to Sticky, as in the steps above. On an older theme, look for a sticky or fixed header option in Appearance › Customize or your theme's own settings.

Why doesn't my sticky header stay at the top?

Most often the Sticky setting is on the group inside the header part. The header part wraps that group, so it has no room to stay put and scrolls away. Wrap the header part itself in a group in the template, and make that group sticky.

Will it work with my theme?

Yes, if it's a block theme: your dashboard shows Appearance › Editor. How to tell. On an older (classic) theme it can't add the CSS itself, but it writes it for you to paste into Appearance › Customize › Additional CSS. We haven't tried it on a header made with a page builder such as Elementor or Divi.

Can I undo it?

Yes. Press Undo on the card. In our test run it took the styles off, checked the page and said: “Undone. I checked afterwards, and it's back the way it was.” Doing it yourself, set Position back to Default and save.

Is it free?

To start, yes: 3 changes with no account, then 10 a month once you add your email. Questions are free, up to 30 a day.

Written by the CMSHands team. First published .

Try it on your own header

  1. 1. Download the plugin.A free zip file
  2. 2. Upload and activate it.Plugins › Add Plugin › Upload Plugin
  3. 3. Give CMSHands a task.Press Start working, then ask in your words
Download the free plugin

Get the plugin here instead

Works best on WP 6.3 or newer with PHP 8.0 or newer. What works on older sites

Download the free plugin