How to Add Custom CSS to the WordPress Editor (Block and Classic)

Want your WordPress editor to look the way you like, or to match your site’s fonts and colours exactly? You can add custom CSS to the WordPress editor with a few lines of code using editor styles. I’ve used a dark editor with light text for years because it’s easier on my eyes during long writing sessions. Here’s how to add custom CSS to the WordPress editor in 2026, for both the block editor (Gutenberg) and the Classic Editor.

add custom CSS to the WordPress editor with a dark editor style

Quick answer: In your child theme’s functions.php, add add_theme_support( 'editor-styles' ); and add_editor_style( 'editor-style.css' ); inside an after_setup_theme hook, then put your CSS in editor-style.css in the theme folder.

Why add custom CSS to the WordPress editor?

  • What you see is what you get: make headings, fonts, colours and spacing in the editor match the front end of your site.
  • Comfortable writing: use a dark background, larger text or a narrower column for easier reading.
  • Custom classes: preview styled boxes, buttons or notes in the editor exactly as readers will see them.

Before, our Classic Editor looked like this:

no editor styles

Step 1: Enable editor styles in functions.php

Use a child theme so your changes aren’t lost when the theme updates. Add this to the child theme’s functions.php, and keep a backup in case of a typo, since an error here can take your site offline:

function qot_editor_styles() {
    add_theme_support( 'editor-styles' );     // needed for the block editor
    add_editor_style( 'editor-style.css' );   // loads the file from your theme folder
}
add_action( 'after_setup_theme', 'qot_editor_styles' );

add_editor_style() looks for the file in the child theme first, then the parent theme.

Step 2: Create the editor-style.css file

Create editor-style.css in your child theme folder using your host’s File Manager, FTP, or by creating theme files without FTP.

custom editor css

Step 3: Add your CSS

For the block editor (Gutenberg), write normal CSS. WordPress automatically prefixes it with .editor-styles-wrapper, so it only affects the content area, not the admin interface:

body {
  font-family: Georgia, serif;
  font-size: 19px;
  line-height: 1.7;
  color: #ddd;
  background: #222;
}
a { color: #7fff00; }
h2 { border-bottom: 2px solid #f28c1e; padding-bottom: 6px; }
.note { background: #fff3cd; padding: 12px 16px; border-radius: 6px; }

For the Classic Editor (TinyMCE), the content is inside an iframe with the body#tinymce selector:

body#tinymce.wp-editor {
  font-family: Arial, Helvetica, sans-serif;
  margin: 30px;
  color: #ddd;
  background: #333;
}
body#tinymce.wp-editor a { color: #7fff00; }

Save the file and reload the editor (use a hard refresh, Ctrl + Shift + R, if you don’t see changes).

Other ways to style the WordPress editor

  • Block themes and theme.json: in block themes like Twenty Twenty-Five, styles set in theme.json or Appearance → Editor → Styles apply to the editor automatically.
  • Editor interface CSS: to change the admin UI around the content (sidebar, toolbar), enqueue a stylesheet on the enqueue_block_assets or admin_enqueue_scripts hook instead.
  • Import frameworks: you can also add Bootstrap CSS and Font Awesome icons to the editor so their classes preview correctly.

Note that Appearance → Customize → Additional CSS styles only the front end, not the editor.

Frequently asked questions

Does editor CSS affect my live site?

No. Editor styles only load inside the WordPress editor. Your site’s front end uses the theme’s normal stylesheet.

Why isn’t my editor-style.css working?

Check the file name and location, make sure add_theme_support( 'editor-styles' ) is set for the block editor, and clear your browser and caching plugin cache.

Can I use Google Fonts in the editor?

Yes. Pass the font stylesheet URL to add_editor_style() as well, and use the font family in your editor CSS.

Found this useful? Share it with someone who needs it.

Get our free weekly email: new tech guides and tools, no spam.

New and updated tech guides, a free tool worth bookmarking and one useful pick, once a week. No spam, unsubscribe anytime.

One email a week. Unsubscribe anytime. See our privacy policy.

Fresh Tech Guides

Leave a Reply

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

13 Comments

  1. sometime i need css. thanks for sharing a cool article. keep posting this type of article.

  2. Hello P Chandra,
    Amazing post here, this is really helping me in making my page more presentable and attractive. Thank you for the example that is given, making it very easy to use the custom editor style
    Thanks

  3. I Have Tried Many Times to Add Custom CSS Style in Post Editor But Every Time I Failed. Your Tips Help Me a Lot, Now it Works in My Blog. Thanks Again for Helping Us.

  4. For me this post is very helpful for me. I think its the easiest and secure way to add style in WordPress post .

  5. I always wanted to find a way to Maximize my User Experience by giving them an awesome Design via WordPress, thanks for sharing this cool article about it..

  6. cool topic to cover, and thanks for sharing as well, now my question is:
    Will it affect my theme? because my theme don’t have child theme. or do i need to take backup?

    awaiting for reply.
    thanks
    sunil

  7. wow it looks very good and attractive. As WordPress is my favorite platform and i love to work on it and now i am going to update this and will enjoy this new look

  8. I have been running my own e-commerce websites.I have total 10 websites 5 of them are based on word-press.I think this post will be very useful for my new-staff who relatively new to the wordpress .thanks for sharing this because I can explain them this change verbally but You have explained It in very proper manner

  9. Wow that’s great stuff. Can you please tell me how to add custom style sheets on different pages. I mean Home page and my BIO page in different style sheets