I have a MacBook Pro Retina, Mid 2015 running macOS Sierra 10.12.2.

I want to completely stop my power button turning off, sleeping or restarting my device; I have already tried other solutions such as running this command:

defaults write com.apple.loginwindow PowerButtonSleepsSystem -bool no

but all that does is change the behaviour to opening a window with a default action of shut down!

I just want to stop other people, or myself, from purposefully/accidentally using it to turn off my computer. It's a button I've never used, apart from when I first bought my MacBook sometime two years ago.

I still need the button to be able to turn on the device, obviously.

  • 2
    If you completely disable it, how are you going to boot it? – Tetsujin Jan 10 '17 at 8:22
  • @Tetsujin I have not turned off my Macbook ever XD But that's a good point, I just don't want it to sleep/restart/shut down my macbook once it's on. Obviously, having a way to turn on my macbook is kinda important. – theonlygusti Jan 10 '17 at 8:35
  • To be blunt, disabling your Power button is a bad idea. Even if you never intend to turn off your MacBook Pro, the Power button is critical for some troubleshooting steps such as resetting either the SMC or NVRAM. And, as @Tetsujin implies, how are you going to boot it when you do need to (e.g. after a repair or replacing the battery? – Monomeeth Jan 10 '17 at 11:09
  • @Monomeeth quoting from my question: "I want to completely stop my power button turning off, sleeping or restarting my device" also "I just want to stop other people, or myself, from purposefully/accidentally using it to turn off my computer." – theonlygusti Jan 10 '17 at 11:30
  • 1
    How often are you pressing and holding down this button by accident that you need to disable your Mac's hardware? Anyway, my suggestion as someone who has never managed to hit the power button accidentally (and now that I've tried, noticed that it doesn't actually seem to do anything) would be to just keep iTerm open because it unexpectedly stops my computer from restarting about 9 times out of 10. – ian.pvd Jan 10 '17 at 19:29

DanHollis solution is good, but it merely disables the button in software. I'll tell you how to completely disable the button.

You will need:

  • Center hole punch. 1/8" recommended.
  • A hammer, preferably light-weight so you have very fine control of your swing.

Step One

Align the CHP over the power button. The 'Center' in Center Hole Punch is instructive - you need to make sure you're exactly over the switch itself. Done correctly, this will remove the switch without affecting any other components in your MacBook.

Step Two

Swing the hammer. Sounds simple, but it's not. Make the swing fast and accurate, but don't put much force behind it. The point here is to strike quickly enough to punch out the switch itself, but not with enough force to penetrate deeper and actually damage something. Done right, the CHP will strike through and permanently disable the switch. Too fast or forceful and you'll break the computer. Too slow and you'll just turn the computer off.


Your power button is now completely disabled. If the need arises, you can start the computer by manually shorting the contacts the switch connects to. On my desktop I can do this by arcing the pins with a knife, but the MacBook won't offer you the internal space to do that. I leave this as an exercise to the reader.


You might want to practice your hammer swings before doing this for real. I suggest practicing on a meaty part of your leg. The objective is to swing as fast as possible without feeling pain. If you swing too hard, it'll hurt. Too soft, and you'll just be tapping your leg. However, if the hammer bounces back and it doesn't hurt, you're doing it right. Just practice until you're confident and you'll do fine.

  • 1
    If warranty compliance isn't an issue, you could take the MacBook apart and cut the switch off with a Dremel. I've done something similar before with unused pins on an arduino. After that you can just epoxy the button cover back in place and it'll look exactly the same. – UIDAlexD Jan 10 '17 at 20:49

I currently am not in front of my mac but I found this command:

cd /System/Library/CoreServices/loginwindow.app/Contents/Resources/English.lproj
mv PowerButton.nib PowerButton1.nib

here in which you can save it as an app and auto start it at login here

You can also use a program like PowerKey to remap the power button, it will still shut down if you hold it as that is handled by the motherboard, not the OS (whether you're using regular macOS or Windows through Bootcamp)

There is no way of disabling the press and hold force shutdown as it is handled by the hardware and cannot be affected by the software... unless possibly flash an edited BIOS that disables it

If I need to improve this, please tell me how

I will be testing this for myself tomorrow

  • "it will still shut down if you hold it" - this is what i want to disable. Currently, my power button is set to shut down only if it is held. However, I don't want it to shut down at all – theonlygusti Jan 10 '17 at 18:38
  • @theonlygusti There is no way of disabling the press and hold shut down as it is handled by the hardware not the software,well... without disconnectiong or destroying the power button or related circuits, witch both would probably ruin any warranty you have – DanHolli Jan 10 '17 at 18:43
  • @fsb yeah, you're right. I was annoyed at having such a negative reaction on another question. I've deleted my comment (which was worthless XD), however, this answer still doesn't really help because the current solution I have, which I mentioned in my question, already covers what this answer promises. – theonlygusti Jan 10 '17 at 23:30
  • @theonlygusti like I said earlier, you can't disable the force shutdown without damage or flashing a new BIOS (if you even can on a mac) as it is controlled by the hardware or possibly the BIOS – DanHolli Jan 10 '17 at 23:35
  • How do I flash my MacBook's BiOS to solve the issue? If the question can't be answered without overwriting important aspects of the system, let's overwrite those important parts of the system. – theonlygusti Jan 10 '17 at 23:40

I make the app PowerKey, which allows you to remap a tap of the power key to input Forward Delete or another command. Might be useful for some who find this answer. It does not modify the hold-to-shutdown behavior, however, and that is not the goal of the app.

However, there was an issue with OS X Mavericks that had people searching for a way to modify the power key tap and hold behavior. That lead binchewer to release several tools and patches in that vein such as power_fixer.

http://web.archive.org/web/20160202223452/http://binchewer.org/blog/index.php?id=1 https://github.com/binchewer/power_fixer

On the reddit link, binchewer posted a command that, at least at the time, disabled the power key completely.

I'm not sure if it will work today, especially with System Integrity Protection enabled.

WARNING: likely many side effects. Your computer will not sleep automatically when you close the lid. No way to force a restart if your computer hangs. Etc.

Investigating further. Expect to finish in a week. Small hint for those, who want to simply turn the button off:

kextunload /System/Library/Extensions/AppleACPIPlatform.kext/Contents/PlugIns/AppleACPIButtons.kext/

Will need to be run with sudo. Please use and experiment at your own risk.

  • That final command, which is taken from the reddit post, doesn't work. Instead, the button now forces a hard shut down after it has been held a while. – theonlygusti Jan 10 '17 at 23:38
  • @theonlygusti it did work in OS X 10.9.1, you may want to do some investigation around disabling AppleACPIButtons.kext in Sierra if the procedure has changed. You'll likely also need to disable SIP. – pkamb Jan 10 '17 at 23:40
  • SIP is already disabled, DanHolli (another answerer) told me "There is no way of disabling the press and hold force shutdown as it is handled by the hardware and cannot be affected by the software... unless possibly flash an edited BIOS that disables it" – theonlygusti Jan 10 '17 at 23:42
  • Did it actually work in 10.9.1? Or did it just prevent the annoying Mavericks thing? (Instant shut down) – theonlygusti Jan 10 '17 at 23:42
  • @theonlygusti IIRC it completely disabled both tapping and holding of the power key. I quickly disabled it, though, as it was far too annoying to not have the MacBook sleep when I shut the lid. – pkamb Jan 10 '17 at 23:46

Shut down your Mac. Tape the power button down while your Mac is shut down. As you tape it, your Mac should boot up again, then your power button is stuck down and it won't affect your Mac while using it. The only way to shut down your Mac is to go to the Apple menu then click Shut Down.

  • Have you tested this? It seems like this would cause problems. – theonlygusti Apr 11 '18 at 0:06

You must log in to answer this question.

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