macOS Guide
Why does my Mac keep rearranging my desktops?
You arrange your desktops once. Email on 1, code on 2, design on 3. Then, an hour later, they're in a different order and you have no idea why. If your Mac keeps moving your desktops around, there are four real causes, and only one of them is a "feature" Apple turned on for you.
Cause 1: The auto-rearrange setting (the usual suspect)
macOS ships with a setting called "Automatically rearrange Spaces based on most recent use." It's on by default and has been for over a decade. When it's on, macOS watches which desktops you visit and silently moves the ones you use most toward the front. Spend the morning on Desktop 4, and by the afternoon Desktop 4 might be Desktop 2.
This is why the order seems to change "by itself." It's not random, it's not a bug, and it's not malware. It's a feature Apple assumes you want, and most people never find the toggle to turn it off.
The fix:
System Settings > Desktop & Dock > scroll to Mission Control > turn off "Automatically rearrange Spaces based on most recent use." Or, from Terminal: defaults write com.apple.dock "mru-spaces" -bool "false" && killall Dock
Cause 2: Fullscreen apps create and destroy Spaces
Make an app fullscreen and macOS creates a brand-new Space for it, tacked onto the far right of your Space bar. The desktops in between shift to fill the gap. Exit fullscreen and that Space is destroyed, and everything collapses back. Do this a few times a day with different apps and your carefully ordered desktops will drift every single time.
The fix here isn't a setting, it's a habit: avoid true fullscreen mode. On macOS Sequoia and later, drag a window to the top of the screen to maximize it without going fullscreen. On older versions, hold Option and click the green traffic-light button. You get the same screen-filling result without macOS creating and destroying Spaces behind the scenes.
Cause 3: Sleep, lid close, and restarts
Close your MacBook lid, wake it up, and your Spaces may be in a different order. Reboot, and macOS rebuilds the Space list entirely. The auto-rearrange toggle doesn't protect against any of this, and after a restart macOS won't reliably put your apps back on the Space they were on, no matter what "Reopen windows when logging back in" claims. There's no native setting that fixes this class of reordering.
Cause 4: Plugging in or unplugging an external monitor
This is the big one for anyone with a dock or a second screen. When macOS detects a display change it redistributes your Spaces across the available screens. Plug the monitor in and your desktops spread out across both. Unplug it and they collapse back onto the laptop screen, often in a different order. If you dock at work and undock at home, you'll see your Spaces rearranged with every switch. There's no reliable native fix for this one either.
The hidden fifth cause: clicking apps in the Dock
This one looks like rearranging but isn't. With "When switching to an application, switch to a Space with open windows for the application" enabled (it's on by default), clicking a Dock icon teleports you to whatever Space that app has a window on. You don't move, your desktop changes under you, and it feels like you're being yanked around. Turn it off in the same Mission Control settings section, and Dock clicks will behave predictably.
What to do when the order still changes anyway
Even with every toggle off, macOS still identifies your desktops by number, and monitor changes and restarts can still shuffle them. That's why it helps to stop relying on position entirely.
SpaceJump gives each Space a persistent name that follows the Space, not the position. Label Desktop 1 as "Email," Desktop 3 as "Code," and the name stays correct even if macOS decides your "Code" Space is now fourth in line. The Quick Switcher (one keyboard shortcut) lets you jump to any Space by typing its name, so the underlying order stops mattering entirely.
If you want the full walkthrough of stopping the rearranging, including the Terminal method and what to do about restarts, the complete guide to stopping Spaces from rearranging covers all of it.
Frequently asked questions
Why does my Mac keep rearranging my desktops?
The most common cause is the "Automatically rearrange Spaces based on most recent use" setting, which is on by default and silently reorders your desktops so the ones you used most recently move toward the front. Fullscreen apps, plugging in or unplugging an external monitor, waking from sleep, and restarts can also reshuffle your Spaces even after that setting is off.
Why do my desktops keep moving when I use fullscreen apps?
When you make an app fullscreen, macOS creates a new temporary Space and pushes it to the far right of the Space bar. The remaining desktops collapse to fill the gap, and when you exit fullscreen the Space disappears again. With several fullscreen apps, this constantly shifts the position of everything else.
Why do my desktops rearrange after I plug in an external monitor?
macOS redistributes your Spaces across the connected displays when it detects a monitor change. Unplugging collapses them back onto the laptop screen, often in a different order. There's no dedicated setting that prevents this.
Is my Mac rearranging my desktops a virus or a bug?
No. It's a built-in macOS feature called "Automatically rearrange Spaces based on most recent use" that ships on by default. It reorders desktops deliberately based on which ones you used most recently. It feels like a bug because it's on by default and most people never know the setting exists.
Why do my desktops move after a restart?
After a restart or logout macOS rebuilds the Space list from scratch. The auto-rearrange toggle only controls reordering during a session, and "Reopen windows when logging back in" only partially restores which app was on which Space. No native setting restores your exact layout after a reboot.
Related Guides:
Last updated: August 2026