Remove the recent and suggested apps from your Dock
Quick answer
Open System Settings > Desktop & Dock and turn off Show suggested and recent apps in Dock. The extra section near the end of the Dock goes away.
Why it happens
Your Dock can keep a few apps you used lately in a section of their own near the Trash end, set apart by a thin divider line. It may also suggest an app you were just using on your iPhone or iPad. Some people find it handy, but it makes the Dock change length and order.
How to fix it
Open the Apple menu, choose System Settings, and click Desktop & Dock in the sidebar.
In the Dock section, turn off Show suggested and recent apps in Dock.
Desktop & Dock›Dock›Show suggested and recent apps in Dock
If one of those apps is something you use a lot, keep it first. Control-click its Dock icon, choose Options, then Keep in Dock.
Still not fixed?
An app that's open still shows in the Dock until you quit it. That's normal. Press Command-Q in the app to close it fully.
To get to recently used apps without the Dock section, open the Apple menu and choose Recent Items.
Apple menu›Recent Items
If the recent apps come back after you turned the switch off, log out from the Apple menu and log back in.
If they still keep reappearing after a restart, contact Apple Support.
Terminal
Open Terminal (Applications › Utilities), paste this line and press Return.
defaults write com.apple.dock show-recents -bool false && killall DockTo undo:
defaults write com.apple.dock show-recents -bool true && killall DockPro details
Hides the recent-apps section of the Dock.
Questions people ask
How do I stop recent apps showing in my Mac Dock?
Turn off Show suggested and recent apps in Dock in System Settings > Desktop & Dock.
How do I keep an app in the Dock permanently?
Control-click its Dock icon, choose Options, then Keep in Dock.
Related fixes
Glad it worked.
Sorry it didn't. Tell us what happened and we'll fix this page.
Do it in one click with PinSet.
Press ⌃ ⌥ Space and type “dock shows recent apps”. PinSet opens Desktop & Dock › Dock in System Settings and rings Show suggested and recent apps in Dock. On macOS 27 it can also make the change for you, with Undo. One of 2,400+ checked Mac fixes. Works offline.
7 fixes free · Works offline · macOS 26 and 27