WordPress dark mode is a display setting that replaces the standard light interface with a darker colour scheme. It adjusts backgrounds, text and other UI elements to maintain contrast and readability, and it has quickly become something visitors expect.
What Is WordPress Dark Mode?
Dark mode swaps a bright interface for a darker palette while keeping text legible. It is now an expectation rather than a novelty: iOS, Android, Windows and macOS all ship a system-level setting, and browsers pass that preference to your site through the prefers-color-scheme media query. A visitor who has chosen dark everywhere else notices when your site ignores it.
Benefits of WordPress Dark Mode
- Reduces eye strain: a bright screen can cause discomfort, especially when reading on bright white backgrounds. Dark mode reduces glare and light emission.
- Enhances readability in low-light environments: dark mode provides more balanced contrast, making text easier to read without overwhelming brightness.
- Improves accessibility: for users with visual impairments such as light sensitivity or dyslexia, a dark background with well-contrasted text improves readability.
- Saves battery life on OLED and AMOLED screens: dark mode reduces overall power draw on OLED-based displays.
- Provides a modern and sleek design: a dark interface gives a polished, tech-forward appearance.
- Encourages longer browsing sessions: streaming platforms use dark themes to reduce eye fatigue and allow longer engagement.
- Supports better sleep hygiene: dark mode reduces blue light exposure, aligning with sleep hygiene recommendations.
- Differentiates your website from competitors: offering dark mode can make a site stand out.
How to Add Dark Mode in WordPress: 4 Ways
1. Using a WordPress Dark Mode Plugin
Install a plugin such as WP Dark Mode or Darklup, customise your preferences, add a toggle switch, then test and optimise. Popular options include Darklup, Dracula Dark Mode and Dark Mode Toggle.
2. Choosing a Theme with Built-in Dark Mode
Some themes ship with dark mode built in, giving you seamless design integration. Popular choices include Neve, OceanWP, Hestia, Astra, GeneratePress and Kadence.
3. Using a JavaScript Library for Dark Mode
Libraries like darkmode.js and drkmd.js let developers add a dark mode widget with a small snippet. A typical implementation loads the library, then calls a method to show the toggle widget on the page.
4. Implementing Dark Mode with Custom Code
For full control, you can define a dark colour scheme in CSS with a class such as body.dark-mode, add a toggle button, and use JavaScript to switch the class on click. To improve the experience, store the user’s choice in localStorage so it persists, and read the system preference with the CSS media query prefers-color-scheme so the site can adapt automatically.
How to Add Dark Mode to the WordPress Dashboard
Worth clearing up first, because a lot of guides get this wrong: WordPress core still has no dark mode, for the dashboard or the front end. WordPress 7.0 “Armstrong” did redesign the admin in May 2026, and the release notes describe “a chic, modern new color scheme”. That is a visual refresh, not a dark mode, and the announcement does not mention one.
What core does give you is admin colour schemes, under Users then Profile. Midnight and Ectoplasm are dark-ish, but they only recolour the menu and accents rather than turning the whole editing surface dark, so they are not a substitute.
For a genuinely dark backend you still need a plugin. Dark Mode for WP Dashboard, UiPress and WP Adminify all do it. Test any of them against your page builder and your most-used plugins before rolling it out to a client, because admin restyling plugins are the ones most likely to collide with something.
Managed Hosting solutions for WordPress backed by Speed, Security and Scalability
Talk To Sales →Dark Mode In Block Themes And theme.json
Most guides to this topic, including the earlier version of this one, were written when every WordPress site used a classic theme and a stylesheet you edited by hand. If you are on a block theme, which is how WordPress has shipped since Twenty Twenty-Two, the approach is different and considerably tidier.
What theme.json actually gives you
A block theme defines its colours in theme.json, under settings.color.palette. Each entry has a color, a user-facing name and a machine-readable slug. WordPress then generates a CSS custom property for each one, in the form --wp--preset--color--{slug}. A colour with the slug base becomes --wp--preset--color--base, and every block that uses that palette entry references the variable rather than a hard-coded hex value.
Be clear about one thing: theme.json has no built-in dark mode. There is no setting that flips the palette. What it gives you is something better, which is a single named variable behind every colour on the site. That is what makes the next step short.
Overriding the variables for dark mode
Because every colour is a custom property, you can redefine the whole palette inside one media query. In your theme’s stylesheet:
@media (prefers-color-scheme: dark) {
:root {
--wp--preset--color--base: #0f1115;
--wp--preset--color--contrast: #e8e8ea;
}
}
Every block using those presets follows automatically, including ones you have not built yet. No per-block CSS, no toggle script, no plugin. The site simply respects what the visitor already told their operating system.
The trade-off is that this is automatic only. It follows the system setting and gives the visitor no way to override it on your site specifically. If you want a manual toggle you need a small amount of JavaScript to set an attribute on <html> and a matching selector alongside the media query, which is the approach in the custom-code section above.
Style variations, and why they are not quite it
Block themes also support style variations, which are alternative theme.json files a user picks in the Site Editor. A dark variation is a legitimate way to ship a dark version of a theme, and several default themes include one. It is worth knowing what it is not: a variation is chosen by the site owner and applies to everyone, so it changes your site’s design rather than responding to each visitor’s preference. Use a variation to offer a dark design. Use the media query above to respect a dark preference.
Check the contrast before you ship it
Dark palettes fail accessibility more often than light ones, usually because a mid grey that reads fine on white becomes unreadable on near-black. WCAG asks for 4.5:1 on body text and 3:1 on large text, and the same figure applies in both schemes. Pure white on pure black is also worth avoiding, since the high contrast causes halation for a lot of readers. Off-white on a very dark grey is easier on the eye and still clears the threshold.
How to Customise the Dark Mode of Your Website
- Choose the right colour palette
- Provide a toggle option
- Optimise images and media
Choosing the Right Dark Mode Plugin
When selecting a dark mode plugin, consider:
- Installation without hassle
- Performance that doesn’t suffer
- Customisation that matches your brand
- Compatibility with your existing setup
Common Mistakes to Avoid
- Neglecting readability
- Jumping image feature (media that shifts or flickers)
- Using multiple plugins for the same job
- Logos not appearing properly
- Poor contrast between text and background
- Not testing on different devices
- Hardcoding colours
Dark Mode Implementation Methods Compared
| Method | How It Works | Best For |
|---|---|---|
| Plugin | Install a plugin like WP Dark Mode or Darklup | Quick setup, no coding needed |
| Dark Mode Theme | Use a theme with built-in dark mode | Seamless design integration |
| JavaScript Library | Add a script like darkmode.js | Developers who need flexibility |
| CSS and JavaScript | Manually apply a dark-mode class and toggle it | Full control over design |
| System Preference Detect | Use prefers-color-scheme in CSS | Automatic adaptation for users |
| WP Admin Dark Mode | Plugin for backend dark mode | Admins and editors |