43

In Chrome we can close all the tabs in a window while keeping a selected one open.

Is there a keyboard shortcut to "close other tabs"?

enter image description here

0

10 Answers 10

11

There is no keyboard shortcut I know of and after checking Google forums, neither does anyone else.

You could use the extension Close Inactive Tabs instead - This adds a button which closes all other tabs except the active one.

6
  • 1
    There's an entry in the suggestions box.
    – JdeBP
    Commented Jun 18, 2011 at 12:15
  • This extension doesn't work on Mac Chrome 66.
    – 2540625
    Commented May 18, 2018 at 16:37
  • 1
    Link is broken :-( Commented Sep 20, 2019 at 13:03
  • 3
    Well, they removed the whole option now.
    – Everyone
    Commented Nov 5, 2019 at 9:12
  • and added the option again :)
    – discy
    Commented Nov 23, 2019 at 22:07
15

I wrote this extension so that we can assign shortcuts for closing tabs to the right / left / other tabs / pin / unpin tab. Let me know if you can use it.

Update: It's temporarily off from Chrome Store and I'm working to get it back.Meanwhile, you can install it from here: https://github.com/diophung/close-chrome-tabs

custom shortcuts


Update 2019/06/10: Still works with Chrome 75 custom shortcuts

9
  • Your screenshot above shows command-key–based shortcuts, but in the app store it shows option-key–based. Can this be configured? Option key is primarily for typing alternate characters (é, ü, ∞, etc); it shouldn't be used without the command key for commands.
    – 2540625
    Commented May 18, 2018 at 16:26
  • This extension doesn't work on Mac Chrome 66.
    – 2540625
    Commented May 18, 2018 at 16:38
  • 1
    It works flawlessly, many thanks for this little add-on!
    – JKHA
    Commented Jan 26, 2021 at 21:26
  • 1
    It now says: "This extension violates the Chrome Web Store policy." What happened?
    – SU3
    Commented Jan 23, 2022 at 21:15
  • 1
    @SU3 : the extension is back to Chrome Store: chrome.google.com/webstore/detail/keyboard-shortcuts-to-clo/…
    – Dio Phung
    Commented Feb 11, 2022 at 23:02
4

The shortcut key to close all other tabs is CtrlShiftAltW if you install Amazing Tab Shortcuts, freely available in the Chrome Web Store.

I use it frequently for scripts, which I suspect is your use.

        

2
  • 3
    Alas, doesn't appear to work on Linux. Commented Oct 8, 2014 at 1:00
  • 2
    Wohou is such a combination still called "short"cut?
    – user785529
    Commented Sep 9, 2016 at 9:56
3

Here is an extension that assigns a keyboard shortcut to close other tabs. .

Works great on my Mac with Chrome stable channel.

2
  • This extension doesn't work on Mac Chrome 66.
    – 2540625
    Commented May 18, 2018 at 16:38
  • On Mac you can just set a key command to any menu item. You don't need to jump through hoops at all. New answer added.
    – Tetsujin
    Commented Aug 14, 2023 at 16:49
2

None of them work. The easiest way is to right-click on the tab that you want to keep open and then click 'close other tabs'. The shortcut to close ALL tabs is Ctrl+Shift+W, to open a new tab is Ctrl+T, and to close the tab you are on is Ctrl+W. Also, if you close a tab by mistake and want to reopen it to the same page it was on, use Ctrl+Shift+T. Experiment with the rest like, Ctrl+Shift+E, etc.

1
  • 3
    In the question it we can see already that the way how to do this with mouse is known. I think it is not needed to show keyboard shortcuts for other functions here. Commented Oct 17, 2013 at 9:44
2

In OS X you can create ~/Library/Scripts/Applications/Google Chrome/ and save this script there with Script Editor:

tell window 1 of app "google chrome" to close tabs whose id is not (get id of active tab)

Then use FastScripts to give the script a shortcut.

3
  • Hey, this was excellent. Thank you! Commented May 10, 2019 at 23:50
  • Best answer! I use Keyboard Maestro, just added hot key and set action "Execute AppleScript". Works perfect! Commented Aug 17, 2021 at 22:09
  • On Mac you can just set a key command to any menu item. You don't need to jump through hoops at all. New answer added.
    – Tetsujin
    Commented Aug 14, 2023 at 16:48
2

Using Vimium, you can use Ctrl+X to close other tabs (add map <c-x> closeOtherTabs to Vimium -> Options -> Custom key mappings) and Shift+X to restore the last closed tab.

1
  • 1
    Thanks Vimium is great! I'm now using <c-x> but I had to configured that. There was no default shortcut for closeOtherTabs even though the function was there.
    – Frayser
    Commented Dec 24, 2019 at 13:10
2

On Windows

  1. Press F6 twice. This will focus the current tab in the tab bar.
  2. Press ShiftF10. This is the keyboard shortcut for right click on Windows.
  3. Now, you can use the arrow keys to move to the "Close other tabs" and press Enter.
1
  • As a more convenient alternative to Shift+F10, most full-keyboards have a dedicated button for opening a context menu (usually somewhere between Ctrl and Alt. Commented Jun 30, 2023 at 19:49
0

this script is definitely working :

osascript -e 'tell application "Google Chrome"
    set activeTabId to id of active tab of front window
    repeat with tabIndex from (count of tabs of front window) to 1 by -1
        set aTab to tab tabIndex of front window
        if id of aTab is not equal to activeTabId then
            close aTab
        end if
    end repeat
end tell

I use Afred (on Mac) to activate it.

1
  • On Mac you can just set a key command to any menu item. You don't need to jump through hoops at all. New answer added.
    – Tetsujin
    Commented Aug 14, 2023 at 16:52
0

On Mac you can add a keyboard shortcut to any menu item.
This still works on Ventura, but the location has moved. [Use search in Settings]

enter image description here

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .