WordPress additional CSS: where to add it and how to change a button colour

WordPress additional CSS is a field where you add your own styling rules without touching the theme files. In a classic theme you'll find it under Appearance → Customize → Additional CSS, and in a block theme in the Site Editor, under Styles. The change works as soon as you save it and survives theme updates.

Author: The TellMyShop team. A guide for WordPress site and WooCommerce store owners: the cause, the manual fix and the same work in a chat conversation.
Last updated: · 5 min read

Before you write CSS: a setting may be enough

The easiest button colour is the one you set without code. Check these first:

  • Block theme: Appearance → Editor → Styles. In the block or element settings you'll find buttons and can change their background and text colour for the whole site.
  • Classic theme: Appearance → Customize. Many themes have a colours or buttons section there.
  • WooCommerce store: Add to cart buttons usually take their colour from the theme, so a change in the theme styles is often enough.

You need CSS when there is no such option, or when you want to change one specific button.

Where additional CSS is in your theme

Theme typeWhere to add CSSNotes
Classic (e.g. Astra, OceanWP)Appearance → Customize → Additional CSSlive preview on the right, saved with the Publish button
Block (e.g. Twenty Twenty-Five)Appearance → Editor → Styles, three-dot menu → Additional CSSsaved in the theme's global styles
Block, one block typeStyles → Blocks → chosen block → AdvancedCSS for that block only
More than a few rulesthe child theme stylesheetneeds access to the files

CSS from the Site Editor and CSS from Customize are two separate places. The WordPress core team note on CSS in global styles explains this. If you have a block theme but once added CSS in Customize, it is worth moving it into one place, so that a year from now you know where to look.

How to change a button colour step by step

  1. Open the page with the button, right-click it and choose Inspect. You'll see the element's class, for example wp-block-button__link or button.
  2. Go to the additional CSS location from the table above.
  3. Add a rule, for example:
.wp-block-button__link {
  background-color: #1f6f5c;
  color: #ffffff;
}
.wp-block-button__link:hover {
  background-color: #17574a;
}
  1. Watch the preview. If the colour didn't change, a theme rule is stronger. Put the name of an area before the class, for example .site-footer, rather than forcing the rule with important straight away.
  2. Publish or save the changes.
  3. Check the page in a private window and on a phone. The text colour must be readable on the new background.

The colours in the example are just examples. More approaches, including a child theme and a plugin, are covered in Hostinger's guide to custom CSS in WordPress.

What else a few lines of CSS can fix

Button colour is the most common request, but the same field helps with other small styling fixes:

  • Hiding an element, for example the date under posts or the author name, with a display: none rule. The element is still in the page code, you just can't see it.
  • Spacing, when a heading sticks to an image or buttons sit too close together on a phone.
  • Font size in one place, for example the footer, without changing the theme's whole typography.
  • Link colour in post content, when the theme's colour is too pale on a white background.
  • Mobile layout, with a rule that has a screen-width condition and only applies on narrow screens.

Two habits will save you searching a few months from now. Above each rule, add a comment between /* and */, for example “green buttons, October 2026”. And keep all your fixes in one place, not a bit in Customize, a bit in the editor styles and a bit in a page builder plugin's settings. Then you can easily see which rule does what, and remove the ones you no longer need without worrying.

A word of caution about hiding things. If you hide text that matters to customers this way, for example shipping costs, it disappears from the screen but not from the store's obligations. Fix that kind of content at its source.

When additional CSS isn't enough

Additional CSS changes how things look, not the content or the HTML structure. You can't use it to add new text to the footer or move a button to another section. For that you need templates in the Site Editor or files in a WordPress child theme. They are described in the WordPress Theme Handbook.

If nothing changes after saving even though the CSS is correct, caching is often to blame. We describe the order for clearing it in the post WordPress changes not showing.

How the chat changes CSS with a preview

The TellMyShop plugin for WordPress and WooCommerce lets your chat (Claude or ChatGPT) read your current additional CSS and add or replace part of it. Before saving it checks that the braces match, and it warns you about loading styles from other domains. In a block theme it also changes colours and typography in global styles.

You: The buttons on the site are grey, make them green like the logo.

Your chat: The theme is classic and the additional CSS already has two rules. I'll add at the end:

White text on this green is readable. Save? (yes / no)

You: Yes.

Your chat: Saved. I checked the home page logged out: the buttons are green.

Card status: waiting for your “yes”
change preview

new version: .wp-block-button__link { background-color: #1f6f5c; color: #ffffff; }

new version: .wp-block-button__link:hover { background-color: #17574a; }

Illustration: products, numbers and replies are examples.

CSS and global style changes work in TellMyShop Pro once the Theme switch is on in the plugin panel. The switch lasts 24 hours and needs a database backup from today. The chat prepares the preview even while the switch is off, and saves only once it is on and after your ‘yes’. The change goes into the change history and you can undo it with one instruction.

The free TellMyShop Free version doesn't read or change the site's design, so it won't help much with this task. You'll find a description of both versions on the TellMyShop for WordPress and WooCommerce page, and prices on the pricing page. More guides are on the blog.

Questions and answers

Will additional CSS disappear after a theme update?

No. WordPress stores additional CSS in the database, not in the theme files, so an update doesn't touch it. It is tied to the theme you added it in, though. If you switch themes, you need to copy it across.

I added CSS and nothing changed. Why?

Usually the selector doesn't match the element, or a theme rule is stronger. The second common cause is caching, so check the page in a private window. In a block theme, also make sure you added the CSS in the Site Editor styles and not in the old Customize screen.

Can bad CSS break my site?

It won't take the site down the way a PHP error can. It can hide an element, break the layout or turn text an unreadable colour. So change one rule at a time and check the page straight away, on a phone too.

Do I need a plugin to change a button colour?

No. In a block theme you set the button colour in global styles, and in a classic theme often in the theme options under Customize. Additional CSS is useful when the theme has no such option.

WordPress is a trademark of the WordPress Foundation. WooCommerce is a trademark of Automattic Inc. Claude is a trademark of Anthropic PBC. ChatGPT and OpenAI are trademarks of OpenAI. TellMyShop is not affiliated with these companies.

TellMyShop for WordPress and WooCommerce

Your chat reads the site, shows every change before saving it and saves only after your yes. You can undo most changes with one sentence. Works with Claude or ChatGPT, free accounts included.

Read next