If you find that your iPhone battery drains quickly when you are away from home or work, it is because your phone is constantly searching for available Wi-Fi networks. To stop searching on the go, you can go to your WiFi settings and turn off the Ask to Join Networks option.
When you do this, your iPhone will stop searching for available Wi-Fi networks around you, but you can still turn on Wi-Fi networks manually and your phone will start scanning for networks and will not have the Wi-Fi -Fi search for available networks feature at the phone's battery level.
However, there is at least one Wi-Fi network that you will always want to automatically connect to, and this is where the automation features available in the Shortcuts app come in handy.
Apple added this feature to iPhone so that it can detect when you left your home, office, or other specified location and allow it to perform the action you added to your shortcut while you are away from that location.
This feature can be used to turn off Wi-Fi to save battery when you move your iPhone from one place to another and automatically turn it back on when you return to a certain place. We'll show you how to use this function below:
How to turn off Wi-Fi automatically on iPhone to save battery power:
All you have to do is create a shortcut in the Shortcuts app associated with leaving your home, office, or anywhere else you want to go and your Wi-Fi will automatically turn off.
The methods are as follows:
1. Open the Shortcuts app on your iPhone and tap on the Automation button shown below.
2. Click on the blue plus sign (+) in the upper right corner.
3. Select (Create a personal automation).
4. A list of options will appear, click Finish.
5. Select the (Anytime) option and click the Select button that appears next to the word (Location).
6. Click Current Location or enter an address.
7. Click Finish and then click Next.
8. On the screen that appears, click (Add Action).
9. Find WLAN in the integrated search field and select (WLAN Configuration).
10. Click on the word (turn on) next to the option (turn on Wi-Fi) to change it to (off).
11. Click Next, then click Finish on the screen that appears.
Then when you leave your home or a place of your choice, WiFi will automatically turn off. To turn it back on automatically when you return to the same place, repeat all the previous steps but select Arrive instead of Leaving and leave the On option next to Turn Wi-Fi the same way.