Custom CSS for WordPress that stays when you change themes

Adminkeep adds Appearance → Custom CSS: one stylesheet that belongs to your site rather than to a theme. It prints on whichever theme is active, so a redesign doesn't take your tweaks with it.

free · Appearance → Custom CSS · classic and block themes

Custom CSS screen under Appearance with a code editor for site-wide CSS
Appearance → Custom CSS: one stylesheet for the site, whatever the theme.

Why Additional CSS disappears

WordPress keeps Additional CSS per theme. On a classic theme it lives in the Customizer; on a block theme it lives in the Site Editor's Styles. Either way it belongs to the theme that was active when you saved it, so switching themes leaves it behind.

Nothing is deleted. Switch back and it returns. WordPress just doesn't carry it across to the new theme, or tell you it stayed behind.

Where WordPress keeps custom CSS, and why it vanishes →

Site-wide CSS, stored by the plugin

The CSS is kept in a site option that belongs to Adminkeep, not to a theme, and printed in the head of every front-end page.

Prints on every theme

Classic or block, old theme or new: whichever theme is active, your CSS is on the page.

Works next to Additional CSS

Your theme's Additional CSS is left alone, and you can keep using both. Adminkeep's CSS prints after it, so the site-wide rule wins when the two disagree.

Front end only

It styles the site visitors see. It isn't loaded in the admin or in the block editor, so check the result on the site itself.

Kept when switched off

Switching the feature off stops the CSS printing and removes the menu item. The CSS is kept until you uninstall, so switching it back on brings it back.

WordPress's own code editor

The editor is the one WordPress uses for its own CSS box: line numbers, syntax highlighting, and linting that flags mistakes as you type. If you have switched syntax highlighting off in your profile, you get a plain text box instead.

It sits in the Appearance menu on classic and block themes alike, not several clicks deep in the Site Editor.

  • HTML is refused. Anything that looks like an HTML tag is rejected when you save, with your text kept on screen to fix, so a pasted snippet can't slip a <script> tag into the page.

  • Administrators only. The screen needs the same two permissions that guard WordPress's own Additional CSS (edit_theme_options and edit_css), so editors don't see it. On multisite, only super admins can use it.

From the command line

With WP-CLI, wp adminkeep css get prints the stored CSS and nothing else, so it can go straight into a file. wp adminkeep css set replaces it from a file or from standard input, with the same HTML check as the screen.

wp adminkeep feature enable custom_css
wp adminkeep css get > site.css
wp adminkeep css set site.css
cat site.css | wp adminkeep css set

Keep one stylesheet in version control, or copy it from one site to the next. Clearing stored CSS asks for confirmation first; --yes skips the question.

WP-CLI reference →

Turn it on in a minute

  1. 01

    Install Adminkeep from Plugins → Add New Plugin (search "Adminkeep") and activate it.

  2. 02

    Go to Settings → Adminkeep and switch on Custom CSS, in the Appearance group.

  3. 03

    Open Appearance → Custom CSS, add your CSS and press Save CSS.

Why WordPress custom CSS disappears

Where custom CSS can live in WordPress, which places are tied to a theme, and a few safe site-wide rules to start with.

Read the guide →

Custom CSS docs

The setting itself, alongside every other Adminkeep feature and its defaults.

Read the docs →

Switch on what you need. Forget the rest.

A free WordPress plugin — GPL, instantly reversible, and updates come to you.

Type to search the whole site.