Backend menu sidebar collapsed by default every time? [duplicate]

I would like the backend left menu sidebar be collapsed by default. Yes, I can click the “Collapse menu” button every time but is there a way to have WP open up every time with it collapsed by default?

I tried this solution but it didn’t work for me: How to Make admin Sidebar Menu always be Collapse by code

I’m also trying to apply this to a multisite website, not sure if that’s why the code from the link didn’t work.

Any ideas on how to achieve this?

1 Answer
1

The following works with a regular site. I have’t worked with multisite yet, but I imagine it should be something along the same line:

function change_user_settings() {
    set_user_setting('mfold', 'f'); //Missing "t" typo caused fatal error
}

add_action('admin_init', 'change_user_settings');

Leave a Comment