Change multisite the admin bar logo link.

I want to change the following multisite admin bar custom logo link.
https://monosnap.com/file/n0q6lAt271EKzISgQhO9rfUEWSWABV

I tried this and it works well in single site but on multisite, it is not working. https://premium.wpmudev.org/forums/topic/change-the-url-of-the-wp-logo-on-admin-bar-at-the-top-left-corner#post-752560

Please help.

  • Adam Czajczyk

    Hello Josh

    I hope you're well today and thank you for your question!

    The code that you tried should work but you might need to apply it in a different way. Instead of adding it to a "functions.php" file add it to the site as MU-plugin. To do it:

    - create an empty file with a php extension (e.g. "my-custom-dashboard-logo-link.php")
    - copy an past the code into it
    - before that code, as a very first line, add PHP opening tag:

    <?php

    - save the file and upload it to the server to the "/wp-content/mu-plugins" folder; if there's no "mu-plugins" folder inside "wp-content", just create one.

    I just tested this on my multisite and this way it seems to be working fine, as expected.

    Would you give it a try? Please note: if you add such mu plugin you must remove the same code from functions.php, otherwise it will cause errors.

    Best regards,
    Adam

  • Predrag Dubajic

    Hi Josh,

    It seems that something is preventing the code to work on your site, for example if you use only this part of the code:

    add_action( 'admin_bar_menu', 'wp_admin_bar_wp_menu_new', 11 );
    
    function wp_admin_bar_wp_menu_new( $wp_admin_bar ) {
    
           $wp_admin_bar->remove_menu('wp-logo');
    
    }

    It should remove that icon completely, and this works fine on my multisite I tested, but it doesn't work at all on your end.
    So it seems that something specific on your site is affecting this, it could be just caching so try clearing all the caches on your site, including the SG cache and see if that helps.

    If not try disabling your plugins and switching to default WP theme in order to see if any of those are affecting this.

    Best regards,
    Predrag

  • Adam Czajczyk

    Hi Josh

    If you tried that the way I suggested and it still doesn't work, I'd say there's something else interfering or something has been done wrong. To be honest, I don't think a that's a reason good enough to re-install entire Multisite - unless it's not a live site and is relatively simple.

    Have you already started that re-install? If not and would like to give it another chance, let me know. I would need full access credentials, though. In such case please leave all the code that you already added on the site, intact and you can send access credentials directly to me.

    Note: Don't leave your login details in this ticket.
    Instead, you can send us your details using our contact form https://premium.wpmudev.org/contact/#i-have-a-different-question and the template below:

    Subject: "Attn: Adam Czajczyk"
    - Site login URL
    - WordPress admin username
    - WordPress admin password
    - FTP credentials (host/username/password)
    - cPanel credentials (host/username/password)
    - Folder path to site in question
    - Link back to this thread for reference
    - Any other relevant urls/info

    I could then give it a shot and hopefully make it work for you (if I wasn't able to, I'd let you know, of course).

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.