Skip to main content
Customize your MainWP Dashboard logo using PHP code snippets in the free Custom Dashboard extension. You can change the logo image, the URL it links to, and its alt text.

What You’ll Learn

  • Replace the default MainWP logo with your own
  • Change where the logo links to
  • Update the logo alt text for accessibility

Prerequisites


Available Hooks

These hooks let you customize different aspects of the logo:
HookPurpose
mainwp_menu_logo_srcChange the logo image
mainwp_menu_logo_hrefChange where the logo links to
mainwp_menu_logo_altChange the alt text

Change the Logo Image

1

Install the Custom Dashboard extension

Install the Custom Dashboard extension.
2

Upload your logo

Upload a 168x35px image to your WordPress Media Library or via FTP to your Dashboard site.
3

Add the code snippet

Navigate to the Custom Dashboard extension and add this snippet to the PHP tab:
add_filter( 'mainwp_menu_logo_src', 'mainwp_custom_logo' );
function mainwp_custom_logo() {
    return '/wp-content/uploads/logo.png';
}
Custom Dashboard extension PHP tab with logo source code
4

Update the image path

Change /wp-content/uploads/logo.png to your actual image location.
To verify the path works, temporarily use a full URL like https://your-dashboard.com/wp-content/uploads/logo.png. Once confirmed, switch back to the relative path.
5

Save changes

Click Save Changes. The new logo appears immediately.

By default, the logo links to the MainWP Overview page. You can change this destination.
1

Open Custom Dashboard

Navigate to the Custom Dashboard extension’s PHP tab.
2

Add the code snippet

Add this snippet:
add_filter( 'mainwp_menu_logo_href', 'change_logo_url' );
function change_logo_url() {
    return 'admin.php?page=managesites';
}
Custom Dashboard extension PHP tab with logo URL code
3

Update the URL

Change admin.php?page=managesites to your desired destination page.
4

Save changes

Click Save Changes.

Change the Logo Alt Text

Update the alt text for accessibility and SEO.
1

Open Custom Dashboard

Navigate to the Custom Dashboard extension’s PHP tab.
2

Add the code snippet

Add this snippet:
add_filter( 'mainwp_menu_logo_alt', 'change_logo_alt_text' );
function change_logo_alt_text() {
    return 'Your Company Name Dashboard';
}
Custom Dashboard extension PHP tab with logo alt text code
3

Update the alt text

Change Your Company Name Dashboard to your desired alt text.
4

Save changes

Click Save Changes.

Self-Check Checklist

  • Custom Dashboard extension installed and active
  • Logo image uploaded to Dashboard site
  • Code snippet added with correct path
  • Changes saved
  • New logo displaying correctly