This method is dedicated for those who want to activate WordPress maintenance mode without touching a single line of code.
Go to your Wordpress dashboard and under plugins section select Add New and search for plugin called WP Maintenance Mode once found press Install Now and wait until installation is done.
2. Once it's completed the button will change to Activate, then you need to click on it.
3. After the activation, configure the plugin’s settings and turn it on. To do this go to your right tab and choose Settings -> WP Maintenance Mode
4. Fill all your preferred details under General tab, choose background image or colour, customise the maintenance messages under Design tab.
5. To enable the maintenance simply choose Activated mode in general settings and press Save settings.
6. When plugin is activated, all users will see the maintenance page. If you want to access the admin panel use the following link: https://your-domain.com/wp-admin
NOTE: You can find this guide with more details explained and other methods of turning Maintenance mode HERE.