How to Set Dashboard to Use One Column

Code Sample Matrix

I’m working on a plugin where I need the Dashboard to have one column for all users. While I could log into every user and change their Screen Options to one column, it would take next to forever with thousands of students accessing this site. Thankfully, I found this bit of code on Stackexchange (thanks sorich87!) and modified it for the Dashboard page. This will force all users to have one column on the Dashboard.

function screen_layout_columns( $columns ) {
$columns['dashboard'] = 1;
return $columns;
}
add_filter( 'screen_layout_columns', 'screen_layout_columns' );
function screen_layout_dashboard() {
return 1;
}
add_filter( 'get_user_option_screen_layout_dashboard', 'screen_layout_dashboard' );
view raw one-column-dashboard hosted with ❤ by GitHub

1 thought on “How to Set Dashboard to Use One Column”

  1. Mr Slushman,

    I want to thank you for developing the buddybar widget. I am using it on two sites I’ve been working on. It has worked great and I have finally figured out how to edit the css to my liking. I just updated one of my sites to the latest version of WP and I cannot get the widget installed. It won’t even show up.
    Any advice on how I can make this work? Or do I need to go back to the previous version of WP.
    Again, thanks for the great widget and I understand if you are too busy to respond.

    Rick

Leave a Reply