Work Services Journal About Contact
Warsaw Contact

Theming the MainWP Dashboard: Logo and Colors

MainWP is the dashboard I manage client WordPress sites through: updates, backups, security checks, all from one place instead of logging into each site separately. It is a genuinely good tool, and the one thing it does not give you out of the box is a dashboard that looks like your own brand instead of MainWP's. These two snippets fix that: one swaps the logo, the other recolors the whole admin interface with CSS custom properties.

Swap the logo

Add this as a new PHP snippet in Code Snippets, set to run only in the administration area, never in functions.php. Point it at your own square logo in the media library:

add_filter( 'mainwp_menu_logo_src', 'mainwp_custom_logo' );
function mainwp_custom_logo() {
  return '/wp-content/uploads/2025/01/yoursquarelogo.png';
}

Recolor the dashboard

The full theme is a CSS file built around custom properties, so recoloring the whole interface is a matter of swapping hex values rather than hunting down individual selectors. Here is the start of it, a dark theme with purple accents by default:

:root {

  /* Sets color for primary button and text links. */
  --accent-color: #624ec1;

  /* Sets background color for the main navigation and top header elements. */
  --background-color-1: #000000;

  /* Sets background color for vertical menu, modal, accordion, sub-header, actions bar and segment elements. */
  --background-color-2: #111111;

  /* Sets background color for table headers, widgets, cards, modal headers and navigation wrapper elements. */
  --background-color-3: #111111;

  /* Sets background color for form field elements. */
  --background-color-4: #000000;

  /* Sets background color for table elements. */
  --table-background-color: #111111;

  /* ...the rest of the file themes text color, borders and hover states the same way. */
}

The full stylesheet also covers table backgrounds, borders, hover states and form fields the same way; it is long enough that I will not paste all of it here, but it is on GitHub in full. To load it, add a second PHP snippet (admin area only) that prints it inside a style tag on admin_head:

add_action( 'admin_head', function () {
  echo '<style>
    /* paste the theme CSS from below here */
  </style>';
} );

Notes

You need the MainWP Dashboard plugin installed for either snippet to do anything, obviously. The CSS theme is big enough that I keep it as a separate file I paste in rather than something I write from scratch per project; grab it from the repo and change the variables at the top to match whatever brand you are theming it for.

Full source on GitHub: djaysan/mainwp-theming. If you want your MainWP dashboard themed as part of a hosting or maintenance setup, get in touch.

Let’s build

Have a project in mind?

Get in touch