How to Center a Button in WordPress (Block Editor and CSS)

How to center a button in WordPress

A centered button looks balanced and pulls the eye straight to your call to action. But WordPress places new buttons on the left by default, and many people get stuck because the alignment option is not on the button itself.

This guide shows you how to center a button in WordPress three ways: with the core Buttons block, with the free Buttons (UB) block from Ultimate Blocks, and with a few lines of CSS for theme or form buttons.

Quick answer

To center a button in the WordPress block editor, click the button, then select its parent Buttons block. In the block toolbar, click the justification icon and choose Justify items center (or set Justification to Center in the sidebar’s Layout panel). Click Save.

  • Easiest option: the free Ultimate Blocks Buttons (UB) block adds buttons centered by default.
  • Theme or form buttons: use CSS such as display: block; margin: 0 auto;.

Which method should you use?

MethodBest forWhere you set itCost
Core Buttons blockButtons you already added with the default blockParent Buttons block: toolbar or Layout panelFree, built in
Buttons (UB) blockNew buttons that start centered, with hover colors and iconsCentered by default, Justification in the Layout panelFree (animations need Pro)
Custom CSSTheme, shortcode and contact form buttonsAdditional CSSFree
Checked against WordPress 7.1 and the Ultimate Blocks docs in November 2026.

Method 1: Center a button with the core WordPress Buttons block

Best for: buttons you added with the default WordPress Buttons block.

The key thing to know: the Buttons block is a container that holds one or more single Button blocks. Alignment lives on the container, so you will not find a center option while the single button is selected.

Step 1: Select the parent Buttons block

  1. Open your post or page in the block editor. No button yet? Click the + (Block Inserter), search for Buttons and add it. See how to add buttons in WordPress for the details.
  2. Click the button once.
  3. Click the Select parent block icon at the far left of the block toolbar. The toolbar now belongs to the Buttons container.

Tip: you can also open the Document Overview (List View) and click the Buttons item.

Step 2: Set the justification to center

  1. In the block toolbar, click the justification icon (Change items justification).
  2. Choose Justify items center.

Prefer the sidebar? With the Buttons block selected, open the Settings tab, find the Layout panel and click the Center icon under Justification. The same panel has Orientation, so you can stack buttons vertically and still keep them centered.

Step 3: Save your changes

Click Save (or Update) and check the page on the front end. All buttons inside that Buttons block are now centered as a group.

How do you center a button vertically?

  • If the button sits in a Columns block next to text or an image, select the column and use Change vertical alignment in the toolbar, then pick Align middle.
  • If it sits in a Group, Row or Cover block, select that parent block and use its vertical alignment or content position control.

Method 2: Center a button with the Ultimate Blocks Buttons (UB) block

Best for: new buttons that should be centered from the start, plus easy hover colors, icons and nofollow or sponsored links.

Ultimate Blocks is a free block plugin active on 50,000+ WordPress sites, rated 4.9 out of 5 from 700+ reviews on WordPress.org. Its Buttons (UB) block is centered by default, so in most cases there is nothing to change.

Live example: centered Buttons (UB) blocks

These are real Buttons (UB) blocks. The first one uses the default Center justification. The second shows two buttons centered side by side.

Step 1: Install Ultimate Blocks

  1. Go to Plugins > Add New Plugin.
  2. Search for Ultimate Blocks, then click Install Now and Activate.

Step 2: Add the block

  • New button: click the + (Block Inserter), search for Buttons (UB) and click it, or type /button and press Enter. Type your text and add your link.
  • Existing core button: select the Buttons block, click Transform in the toolbar and choose Buttons (UB). The text, link and colors carry over.

Step 3: Check or change the justification

  1. Select the block and open the Settings tab (gear icon) in the sidebar.
  2. In the Layout panel, set Justification to Center. You can also pick Left, Right or Space between, or change it from the block toolbar.
  3. To add a second button next to the first, click the + beside the last button. Both stay centered as a group.

Want a button that spans the full width instead? Set Button Width to Full in the Width & Size panel. The Buttons (UB) block documentation lists every setting.

Centering, colors and icons are free. Ultimate Blocks Pro adds Fade and Wipe hover animations and Saved Styles, so you can save one centered, on-brand button design and reuse it on every post. Plans start at $39/year for one site, with a 30-day money-back guarantee.

Method 3: Center a button with CSS

Best for: buttons the block editor does not control, such as a theme button, a shortcode button or a contact form submit button.

Center a block editor button with a custom class

  1. Select the parent Buttons block and open Advanced in the Settings tab.
  2. Type center-buttons in Additional CSS class(es).
  3. Add this CSS to your site:
.center-buttons {
  justify-content: center;
}

Center a theme or form button

Most single buttons can be centered by turning them into a block element with equal side margins. Replace .my-form with the class of your form or wrapper:

.my-form button,
.my-form input[type="submit"] {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

If the button is an inline link inside a paragraph or container, text-align: center; on that container also works.

Where to add the CSS

  • Block theme: go to Appearance > Editor > Styles, open the Styles menu (three dots) and choose Additional CSS.
  • Classic theme: go to Appearance > Customize > Additional CSS.
  • One Ultimate Blocks block only: use the block’s Custom CSS option, which applies your CSS to that block alone.

Why won’t my button center in WordPress?

  • You selected the single button. Select the parent Buttons block, where the justification setting lives.
  • The button is set to full width. A 100% width button fills its container, so centering has no visible effect. Choose a smaller width.
  • Your theme CSS overrides it. Clear your cache, then look for theme styles that force justify-content or text-align on buttons.
  • A plugin made the button. Form, shop and popup plugins style their own buttons. Use their alignment setting or the CSS in Method 3.

Related guides:

Supercharge Your WordPress Block Editor!

Black Friday deal coming: from November 20 to December 2, 2026, use code BF2026 for 50% off Ultimate Blocks Pro, or get 40% off the full WP Block Suite bundle.

Frequently asked questions

How do I center a button in WordPress?

Click the button, select its parent Buttons block, then choose Justify items center from the justification icon in the toolbar. Click Save to publish the change.

Why is there no center option on my button?

How do I center two buttons side by side?

How do I center a button with CSS in WordPress?

Is the Ultimate Blocks Buttons (UB) block free?

Final thoughts

To center a core WordPress button, select the parent Buttons block and set its justification to center. For buttons that start centered and come with hover colors and icons, the free Ultimate Blocks Buttons (UB) block is the quicker choice.

Your next step: open your most important page and center its main call to action. Then give it a color that stands out with our guide on changing button color.

Found this helpful? See more of us on Google.

Add UltimateBlocks.com as a preferred source and our WordPress guides will show up more often in your Top Stories, AI Overviews and AI Mode.

Add us on Google

Free, one tap, remove anytime

Leave a Reply

Your email address will not be published. Required fields are marked *