How to Add Custom CSS to Your WordPress Site

how to add custom CSS to WordPress

Introduction

Learn how to add custom CSS to WordPress—without editing theme files. This guide covers four methods: Customizer, plugin, child theme, and Full Site Editor.

Custom CSS is like a paintbrush for your site: you can change how it looks without touching the theme. Want a different header color? More spacing? Custom button styles? Instead of modifying theme files—which risks losing changes on every update—you can add your own styles safely. In this article, you’ll discover Additional CSS in the Customizer, plugins for custom CSS, child themes, and the Full Site Editor. You’ll be able to tailor your site’s appearance to your needs.

Why Add Custom CSS to WordPress

Custom CSS gives you control over appearance—colors, fonts, spacing, buttons—without installing extra plugins or touching theme code.

A WordPress theme defines the basic look of your site, but it rarely matches your expectations perfectly. You might want to match brand colors, change header font sizes, or add margin in a specific spot. Editing theme files directly is risky—every theme update will overwrite your changes. Custom CSS lets you override theme styles without touching its files. It’s a flexible solution for small tweaks and larger modifications. Basic CSS knowledge helps, but even simple changes—like hiding an element or changing a color—are within reach after a short introduction.

Before You Start: Safety

Always back up your site before making larger CSS changes—even a single line error can break your site’s appearance.

Adding custom CSS via the Customizer or a plugin is relatively safe—WordPress only applies styles, not executable code. Still, it pays to prepare:

  • Backup: Use a plugin like UpdraftPlus or your host’s backup tool. If something goes wrong, you can restore a working version.
  • Staging: For larger changes, test on a copy of your site. Many hosts offer staging environments.
  • Avoid editing theme files directly: Don’t edit style.css or other theme files—use the Customizer, a plugin, or a child theme. Otherwise you’ll lose changes on theme updates.

Important: Always back up before making larger CSS changes. If something goes wrong, you can quickly undo in the Customizer (the “Undo” button), but with plugins and child themes, a backup gives you peace of mind.

Method 1: Customizer (Additional CSS)

The Customizer offers a built-in Additional CSS editor—the simplest way to add custom styles with live preview.

Additional CSS has been available in WordPress since version 4.7. It’s the fastest method for most users. Here’s how to use it:

  1. Open the WordPress admin: Log in and go to Appearance → Customize.
  2. Open the Additional CSS section: Scroll down and click Additional CSS. A text editor will appear.
  3. Paste or type your CSS: Add any CSS rules you want. Changes appear live in the preview on the right.
  4. Save: Click Publish to save. CSS is stored in the database and tied to the current theme.
.site-title {
    color: #1a1a1a;
    font-size: 1.5rem;
}

.entry-content p {
    margin-bottom: 1.5em;
}

Explanation: The first block changes the site title color and font size. The second increases spacing between paragraphs in the content area. Adjust selectors and values to your needs. Remember: CSS added in the Customizer is tied to the theme—it disappears when you switch themes (though WordPress keeps it and restores it if you switch back).

Method 2: Plugin for Custom CSS

Plugins let you add CSS independently of the theme—ideal when you plan to change themes or need advanced options.

  • WPCode: Popular plugin for inserting code (CSS, JS, HTML) in the header and footer. Also offers ready-made snippets. The free version is enough for custom CSS.
  • Simple Custom CSS and JS: Dedicated to custom CSS and JavaScript. Lets you create multiple files, set load order, and display conditions (e.g., only on the homepage).
  • SiteOrigin CSS: Visual CSS editor with live preview. Good for those who prefer a graphical interface over writing code. Integrates with SiteOrigin themes.

Plugins are theme-independent—your CSS stays active even when you change themes. That’s a big advantage if you often test different themes or work on multiple sites.

Method 3: Child Theme and style.css

A child theme is the advanced approach—it preserves changes when the parent theme updates and gives you full control over styles.

If you already use a child theme (e.g., based on our article WordPress Child Theme: Customize Your Site with Ease), you can add custom CSS directly to the child theme’s style.css:

  1. Open the child theme’s style.css: Connect via FTP or File Manager. Go to wp-content/themes/your-child-theme-name/style.css.
  2. Add CSS at the end of the file: Paste your rules below the theme header (Theme Name, Template, etc.). You can add comments to organize the code.
  3. Save and refresh: Changes appear immediately. The child theme loads after the parent, so your styles override the defaults.

Tip: A child theme preserves changes when the parent theme updates. It’s the best method for developers and users planning larger appearance changes. For small tweaks, the Customizer or a plugin is usually enough.

Method 4: Full Site Editor (Block Themes)

For block themes (e.g., Twenty Twenty-Four), add CSS in the Site Editor under the Style section.

If you use a block theme (FSE—Full Site Editor), the Customizer may be unavailable or limited. In that case, go to Appearance → Editor. In the left panel you’ll find the Style or Additional CSS section—depending on your WordPress version. There you can add global styles or styles for specific blocks. The interface differs from the Customizer, but the principle is the same: enter CSS, save, and changes appear on your site.

Did you know: The Full Site Editor has been available since WordPress 5.9 and was expanded in 6.x. Block themes (Twenty Twenty-Three, Twenty Twenty-Four, etc.) are designed for this editor—the Customizer still works in many cases, but FSE offers more options.


Best Practices: Cascade, Specificity, and !important

Understanding CSS cascade and selector specificity helps you avoid overusing !important and writing unmaintainable code.

  • Cascade: CSS works in order—later rules override earlier ones when specificity is equal. Use this instead of !important.
  • Specificity: The selector .button has lower specificity than .entry-content .button. The more specific the selector, the higher its priority. Use browser dev tools (F12 → Inspect) to find the right selector.
  • !important: Use only as a last resort. It overrides almost everything and makes future changes harder. Instead, increase selector specificity.

Example: The theme has .button { color: red; } and you want a blue button. Instead of .button { color: blue !important; }, use a more specific selector, e.g. .entry-content .button or .wp-block-button .button. It’s cleaner and easier to maintain.


Which Method to Choose

Your choice depends on your needs—small tweaks, larger changes, theme switching, or theme development.

  • Customizer (Additional CSS): For small tweaks—colors, spacing, single elements. Fastest start. CSS is tied to the theme.
  • Plugin: When you want CSS independent of the theme (e.g., you plan to change themes) or need multiple conditions (different CSS on different pages).
  • Child theme: For developers and larger changes. Full control, preserved on updates. Requires familiarity with theme structure.
  • Full Site Editor: For block themes. When the Customizer is unavailable or limited.

Pro tip: For most users, the Customizer or a plugin is enough. Choose a child theme when you plan extensive changes or are building your own theme. A plugin is best if you often switch themes and want to keep a consistent style.


FAQ

1. What is custom CSS in WordPress?

Answer: Custom CSS is your own style code that you add to the site to change how elements look—colors, fonts, spacing, hiding elements, etc. You don’t modify theme files; you override or supplement its styles. WordPress offers a built-in editor (Additional CSS) and the option to use plugins or a child theme.

2. Where do I find Additional CSS in the Customizer?

Answer: Go to Appearance → Customize. Scroll down the left panel—the Additional CSS section is at the bottom of the list. Click it to open the editor. Changes appear live in the preview.

3. Will Customizer CSS disappear when I change themes?

Answer: CSS added in the Customizer is tied to the theme. WordPress stores it—if you switch back to the previous theme, the CSS returns. But when switching to a new theme, it won’t be transferred automatically. That’s why a custom CSS plugin is better if you often change themes.

4. When is a plugin better than the Customizer?

Answer: Use a plugin when you plan to change themes and want to keep your CSS, when you need conditional loading (e.g., different CSS on the homepage), or when the Customizer isn’t available (some block themes). Plugins also offer more options for organizing code.

5. Can I add CSS without knowing how to code?

Answer: Basic CSS is simple—a selector (e.g. .button) and a property (e.g. color: blue). You can use ready-made snippets from the web and paste them into the Customizer or a plugin. For more complex changes, learning the basics or hiring a developer helps. Visual plugins (e.g. SiteOrigin CSS) make editing easier without writing code.

6. What is CSS specificity and why does it matter?

Answer: Specificity determines which CSS rule wins when several apply to the same element. The selector #header .title has higher specificity than .title. The more specific the selector, the higher its priority. Understanding specificity helps you override theme styles without using !important.

7. Does custom CSS slow down the site?

Answer: A small amount of CSS (dozens of lines) has negligible impact on performance. Large CSS files (hundreds of lines, many unused rules) can slightly slow loading. Keep things tidy—remove unused code. Most users won’t notice a difference with typical modifications.

8. How do I undo CSS changes?

Answer: In the Customizer you can use the “Undo” button or simply remove the added code and save. In plugins, remove the rules in the plugin settings. With a child theme, restore the previous file version from your backup. Always back up before larger changes.


Summary

  • Customizer (Additional CSS): Simplest method—Appearance → Customize → Additional CSS. Live preview, CSS tied to the theme.
  • Plugin: WPCode, Simple Custom CSS and JS, SiteOrigin CSS—theme-independent CSS, good when planning a theme change.
  • Child theme: For advanced users—child theme’s style.css preserves changes when the parent theme updates.
  • Full Site Editor: For block themes—Appearance → Editor → Style.
  • Best practices: Avoid !important, use specific selectors, back up before larger changes.

Custom CSS gives you control over your site’s appearance without risking loss of changes on theme updates. Choose the method that fits your needs—Customizer for quick tweaks, plugin or child theme for more flexibility. With this guide, you can tailor WordPress to your requirements.

Index