Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared hosting Managed WordPress Cloud hosting VPS hosting By reader location Hosting finder
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Blog Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Setup & site building · Guide

How to Change Button Color in WordPress (Step by Step)

How to Change Button Color in WordPress (Step by Step)

Short answer

Select the Button block, open the Styles tab in the Settings sidebar and pick new Text and Background colors in the Color panel. To change every button, go to Appearance, Editor, Styles and set button colors there, or use your theme's Customizer options in a classic theme.

Key takeaways

  • Single buttons are colored in the Button block's Color panel.
  • Site-wide button colors live in the Site Editor's Styles panel.
  • Classic themes add their own button color options in the Customizer.
  • Core blocks have no per-button hover control, so use CSS or theme options.
  • Elementor buttons have separate Normal and Hover color tabs.
  • Check text and background contrast for readability.

How do you change button color in WordPress?

Select the Button block, open the Styles tab in the Settings sidebar, and choose new Background and Text colors under Color; to change every button at once, use the Site Editor's Styles panel.

The method depends on what you want to change. One button can be styled in the editor, while all buttons should be styled site-wide so they stay consistent.

Hover colors, WooCommerce buttons and page builder buttons each have their own spot. We cover all of them below.

If you still need to add the button itself, start with our guide on how to create a button in WordPress.

Step 1: How do you change the color of a single button?

Click the button to select it, open the Settings sidebar, switch to the Styles tab if you see one, and pick colors for Text and Background in the Color panel.

Click a color option to open the picker. You can choose from your theme's palette or set a custom color with a hex code.

Background can also be a gradient in many themes. Pick the Gradient tab in the color popover to use one.

The Buttons block documentation shows the full set of options for the block.

Note that Buttons is a wrapper block that holds one or more Button blocks. Make sure you have selected the individual Button, not the wrapper, or the color controls will not appear.

Step 2: How do you use a button style preset?

With the button selected, choose a style such as Fill or Outline in the sidebar, then adjust the colors if needed.

Fill gives the button a solid background. Outline gives it a border and a transparent background, with the text color usually matching the border.

Themes can add more presets. Our guide on registering block styles explains how developers create them.

Presets are useful when you want a primary and a secondary button that look different but still match your design.

Step 3: How do you change all button colors at once?

In a block theme, go to Appearance, then Editor, click Styles, open Colors or Blocks, find Button, and set new Background and Text colors for every button on the site.

Site-wide changes apply to buttons that use default colors. Buttons where you set custom colors keep those custom values.

This is the cleanest way to rebrand. One change updates every button in posts, pages, templates and patterns.

Theme authors set these defaults in theme.json. The Global Settings and Styles guide explains how button element styles work there.

How do you add your brand color to the palette?

In a block theme, open Styles, then Colors, then Palette, and add a custom color with your brand's hex code so it appears as a one-click option in every color picker.

This saves typing the same hex code again and again. It also keeps buttons, headings and links on exactly the same shade.

Give each color a clear name such as Brand blue or Accent. The name shows when you hover over the swatch in the editor.

If you later change a palette color, blocks that use it update automatically. Blocks with a typed custom hex value do not, which is another reason to use the palette.

How do you change the border and text color together?

Open the Border panel in the button's Styles tab to set border color, width and radius, then match the border to the background or the text color.

Outline buttons rely on the border for their shape. Set the border and text to the same color for a clean look.

Rounded corners come from the radius setting. A small radius looks modern, while a large one creates pill-shaped buttons.

Step 4: How do you change button colors in a classic theme?

Open Appearance, then Customize, and look for a Colors, Buttons or Global section, since classic themes add their own button color options.

Themes such as Astra, GeneratePress, Kadence and OceanWP all have button settings, but the menu names differ. Check your theme's documentation if you cannot find them.

If your theme has no button option, use Additional CSS in the Customizer. Step 6 shows an example.

Classic themes may also style WooCommerce and form buttons separately from content buttons.

Step 5: How do you change the button hover color?

Core blocks do not offer a hover color control on individual buttons, so set hover colors in your theme's options, in theme.json, in a page builder or with a short CSS rule.

Hover colors give visual feedback when someone points at a button. A slightly darker or lighter shade of the main color works well.

Many classic themes include a hover color field next to the normal button color. Page builders like Elementor have a separate Hover tab.

For CSS, the :hover pseudo-class targets the hover state. MDN's :hover reference explains how it works.

Add a matching :focus-visible style too. Keyboard users then see the same feedback when they tab to the button.

Step 6: How do you change button colors with CSS?

Add a CSS rule in Additional CSS that targets the button class, such as the WordPress element button class, and sets background, text and hover colors.

This example changes block buttons across the site:

.wp-element-button,
.wp-block-button__link {
  background-color: #1d4ed8;
  color: #ffffff;
}
.wp-element-button:hover,
.wp-block-button__link:hover {
  background-color: #1e40af;
}

To style one button only, give it a custom class under Advanced in the block sidebar, then target that class in CSS.

If your CSS does not take effect, a cache or a more specific theme rule may be winning. Our guide on CSS changes not showing walks through both problems.

How do you change button colors in Elementor?

Select the Button widget, open the Style tab, and set Text Color and Background Color under the Normal tab, then switch to the Hover tab to set hover colors.

For site-wide consistency, set global colors in Elementor's Site Settings and pick them in each widget. Changing a global color then updates every button that uses it.

Elementor's Button widget help page lists all style options, including border and shadow.

If you are new to the builder, see how to use Elementor in WordPress.

How do you change WooCommerce button colors?

WooCommerce buttons such as Add to cart and Place order take their colors from your theme, so change them in the Site Editor Styles panel, theme options or custom CSS.

In block themes, WooCommerce buttons generally follow the site-wide button element styles. Change those and most store buttons update too.

In classic themes, the store buttons may use a separate class such as .button. Inspect the button in your browser to find the right class before writing CSS.

For other store design changes, see our guide on customizing WooCommerce pages.

Which method should you use?

Use site-wide styles for brand colors, block settings for one-off buttons, and CSS only for hover states or cases where no setting exists.

GoalBest method
One button a different colorButton block Color settings
All buttons in a block themeSite Editor, Styles
All buttons in a classic themeCustomizer theme options
Hover colorTheme options, page builder or CSS
Elementor buttonsWidget Style tab or global colors
WooCommerce buttonsSite-wide styles or CSS

How do you pick accessible button colors?

Choose text and background colors with enough contrast so the label is easy to read, aiming for at least 4.5 to 1 for normal-sized text.

The W3C explains the rule in its guide to contrast minimum. Free contrast checkers let you test any two colors.

Low contrast is a common problem with light brand colors and white text. A slightly darker shade often fixes it without changing the brand feel.

Do not rely on color alone to show what a button does. Clear labels like Book a call matter more than the color.

Check hover and focus colors as well as the normal state. A hover shade that looks fine on its own can drop below a readable contrast level once the text sits on top of it.

Finally, view your buttons on a phone outdoors or with the screen brightness low. Colors that look sharp on a large monitor can fade on small screens.

Frequently asked questions

Why can't I change the color of my WordPress button?

You may have selected the Buttons wrapper instead of the individual Button block, or your theme may turn off custom colors. Click directly on the button text, then check the Styles tab in the sidebar. Theme settings and custom CSS can also override block colors.

How do I change the hover color of a button in WordPress?

Core blocks have no hover color control on individual buttons. Use your theme's button hover option if it has one, set hover styles in theme.json, use a page builder's Hover tab, or add a CSS rule with the hover pseudo-class in Additional CSS.

How do I make all buttons the same color in WordPress?

In a block theme, open Appearance, Editor, Styles and set button colors there. In a classic theme, use the theme's button color options in the Customizer. Remove custom colors from individual buttons so they follow the site-wide setting.

How do I change the Add to cart button color in WooCommerce?

WooCommerce buttons use your theme's button styles. Change site-wide button colors in the Site Editor or theme options, or add custom CSS that targets the store button class. Inspect the button in your browser to find the right class first.

What colors work best for buttons?

Pick a color that stands out from the page background and matches your brand, with enough contrast between the label and background to read easily. Use one main color for primary actions and a quieter style, such as outline, for secondary buttons.

Sources

  1. Buttons Block WordPress.org Documentation
  2. Global Settings and Styles (theme.json) WordPress Developer Resources
  3. :hover MDN Web Docs
  4. Understanding Contrast (Minimum) W3C Web Accessibility Initiative
  5. Button widget Elementor Help Center

Is your product missing, or something out of date?

Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.

About the editors

Written and checked byWPLegible Editorial Team Independent WordPress reviews and guides

Researched from the primary sources listed above and checked against our editorial rules before publishing.