

🟡 KnownHost: reliable Dedicated, VPS, Cloud & Shared hosting for WordPress
Most of us don’t share our admin credentials with anyone else. In certain cases, you may want to so temporarily. You can always try a fancy plugin or write your own code. For this, you will have to define allowed start and end times. You should do a check against your users to ignore your own account and only target temporary admins. In this code, the default admin is ignored but the rest of admins are given access between certain times.
You do have the option to block wp-login.php access outside normal hours. You can also log unauthorized access attempts and redirect people to a custom page outside allowed times. It is also possible to change the maintenance message.
More WordPress reading: