How to force Safari 4 to open links in a new Tab instead of a new Window
February 26, 2009 by Ross McKillop
By default, any time a web site uses the target="_blank" attribute on a link (like this one), Safari 4 will open that link in a new window. If you’d prefer it to open in a new Tab, follow the instructions outlined in this brief tutorial.
Start by opening a Terminal window (Applications -> Utilities -> Terminal). Enter the following command:
defaults write com.apple.Safari TargetedClicksCreateTabs -bool true
Now restart Safari. Links that used to open in a new Window (like this one) will now open in a new Tab instead.

If you decide you want to change back, just re-enter the command but replace true at the end of the command with false.



I get
“Unexpected argument true; leaving defaults unchanged.”
And how to do this with the Windows version?
[...] How to force Safari 4 to open links in a new Tab instead of a new Window : Switching To Mac Hidden defaults setting that forces links that would open in a new window to open in a new tab instead. Should be default behavior. (tags: safari macosx) [...]
Thanks! Works great
That’s awesome! Thanks!
Command-Click will do the same thing.
David -
Absolutely true. As does right-click > Open Link in New Tab
Thanks for your tips
Realy great
Works for Safari 3, too
Middle Mouse Button will do the same thing - you can choose how you want to open links. Yup, I said choose!
[...] the tab management has made things worse for many. Thankfully there is a tweek if you want to return the tabs to there original location through the terminal. Windows 7 RC1, Google and EU vs. Microsoft, Kindle 2, Safari, and [...]
Don’t you get the same result by simply doing this: Command-click? No need to mess with terminal.
@Mike -
Absolutely yes. But some people (myself included) would rather just click than have to hold down the command key at the same time. You can also “middle click” (depending on your mouse) to open a link in a new tab, but again, I (and a bunch of folks it seems) prefer just to ‘normal’ left click. Different strokes for different folks
[...] is a quick way to make sure all new links open in a new tab (tutorial via): Start by opening a Terminal window (Applications -> Utilities -> Terminal). Enter the following [...]
As small a thing as it may be, this has played an appreciable role in keeping me with firefox instead of safari. I don’t know why apple doesn’t make this the default behavior for opening links (or even provide the option in the preferences). Thanks a million for clearing my last irritation with safari.
“No need to mess with terminal.” ?
It takes literally 5 seconds to do.
Yes, there’s clearly ways around this (Control Click, etc). But for someone like me that NEVER opens a new window, why work around when 5 seconds of work fixes it?
i just wanted to post how awesome you are!
Another great solution. Many thanks again. I can’t imagine why apple made the change in the first place.
schweet, thanks so much. as a new mac user, this is one of the only things that really, really bugged me. i even downloaded firefox and was really close to ditching safari.
Thanks, this is really great. Is there another command that can force this tab to open in the background? The option is set in Safari preferences, but it doesn’t seem to apply to this new fix.
Awesome. Was exactly what I was looking for! Thanks
Thanks, I recently switched from firefox to Safari on Mac and I missed that feature.
Do you know of any way to force those tabs to open in the background?
Tiny features (or lack thereof) like this drive me absolutely insane. Safari has progressed to a quite fast and slick browser with a graphical page history (a feature I love), but even though this option obviously exists in a config file, they simply couldn’t be bothered to expose it via the Preferences interface…..gee, maybe right under the “Open links from Applications in Tabs” settings.
So let’s see:
1) Click a checkbox or radio button under preferences, or
2) Type in “defaults write com.apple.Safari TargetedClicksCreateTabs -bool true”
Yeah, Macs are definitely easier *rolls eyes*
Thanks! Worked perfectly - and in less than 5 seconds!
Thanks!
I did it just now but my Mac opens link with the same Tab not a new Tab.
How do I fix it?
Can you help me some how?
Thanks so much; I’ve been wanting this for a while, so this hint is great. I’ve always preferred to keep as many tabs in one window as possible, and for simplicity’s sake I’ve wondered why Apple hasn’t agreed with that approach!
Thanks again!
[...] Vía - Switching to Mac [...]
Awesome, works great. been looking for this for a while now
Thanks
Yay! Finally, no more Command-clicking. Works perfectly even for a Macbook newbie like me. Thanks!
Nope, wont work in snow leopard
Eric -
I just confirmed that it does in fact work w/ Safari in Snow Leopard. I set the command to end in false, restarted Safari, and links opened in a new window. I re-ran the command w/ true at the end, restarted Safari again, and they opened in tabs. Remember, you have to restart Safari for the command/change to be enabled.
You rock! That way so annoying. I am very grateful to you for this tip. You have made my life a little better today and for that I thank you.
Thanks, much appreciated. One question: do you know how to make Safari open Google search results (from queries in the default search box) in a new tab instead of in the current tab?
Thanks! Perfect solution.
solid advice!!! thanks a lot for solving an annoying oversight!
Finally!
So frustrating having a bunch of window open!
Thank you!
Thanks so much! Very very helpful, easy solution to my problem. I am perplexed as to why Apple doesn’t give the option of default to new tab instead of new window. It is SO ANNOYING to have windows pop out all the time, to the point where sometimes I would have several windows that I don’t even know existed.
I agree with the rest of you that HELL YES I would rather just click than to option + click. I would like to remind some of you guys that not all of us are using a mouse. I was forced to switch to Safari after FF keeps crashing my computer (do to RAM), a switch I did not want to make. This was one of those reasons that hindered me from switching in the past.
Yeah! Awesome solution. Thank you.
Thank you! This was the key feature needed to make Safari as enjoyable as Firefox.
OMG THANK YOUUUUUUUUUUU
this has been annoying me for ages - I was so sick of apple-clicking on links I thought might open in a new window just in case and then missing most of the ones that do anyway
Works perfectly on my olde worlde g4 ibook. Thank you Sir. I don’t know why this isn’t an option under preferences… go figure.
This solution does not work for me in OS X v10.6.2 and Safari v4.0.4. Is anyone else experiencing this problem? I really want this to work…
Thanks,
David
[...] unable to accomplish this in Safari v4.0.4 and Mac OS v10.6.2. Even though there are multiple blog posts out there explaining a simple solution, it doesn’t seem to work on any of my machines. [...]
Do you have a way to make these tabs open in the background? that would perfect this with a combination of making google searches open in a new window ( which after this fix open in a new tab!!!)
worked…awesome
thx man!!
this may sound strange.. first of all.. i dont know how to open a terminal.. can anyone help me..
thanx soo much
Awesome! Thanks so much!
thanks. good tip.
It was quicker for me to download Firefox than keep trying to make such a basic function work. Ridiculous that either I’m missing something simple or that Safari is. Thank you Mozilla. I shouldn’t have to open my terminal and reprogram anything on a brand new computer, especially for such a simple and popular function. Who on earth wants to have a new window open every time you click a link?
Amazing. No more holding down the Apple key! Thanks!!!!
Works for me in Snow Leopard
I love you, man.
This has been irritating me for months.
Thanks for the tip.
My first apple MacBook and the fix works like a hot damn. I am wondering why there are so many diehards when simple options like this are not included in prefs?