Set up WordPress Maintenance Mode without Plugin

Donations Make us online

If you are planning to perform updates or make improvements to your WordPress website then setting up a maintenance mode page is crucial. This will help ensure a seamless user experience during the process.

In this step-by-step guide, we’ll show you how to enable WordPress maintenance mode without using any plugins. Follow these instructions to optimize your website for updates and improvements.

Step 1: Backup Your WordPress Website

Before diving into the setup process, it’s essential to create a backup of your WordPress website. You can follow this tutorial to learn How to Backup and Restore WordPress without any Issues.

This precautionary measure ensures that your data remains safe in case any issues during maintenance mode.

Step 2: Create a Maintenance Page

Craft a customized maintenance page using HTML and CSS. Design a visually appealing page that informs visitors about the ongoing maintenance and the estimated time for completion. Save the file with an appropriate name, such as “maintenance.html“.

Step 3: Upload the Maintenance Page

Using an FTP client or your hosting control panel’s File Manager, upload the “maintenance.html” file to your WordPress root directory. This directory is typically named “public_html” or “www“.

Step 4: Edit the wp-config.php File

Access the wp-config.php file of your WordPress installation. Open the file in a text editor and add the following code just above the line that says “/* That's all, stop editing! Happy blogging. */“:

if (file_exists(ABSPATH . '.maintenance')) {
    require_once(ABSPATH . '.maintenance');
}

Step 5: Create the .maintenance File

Create a new file named “.maintenance” in your WordPress root directory.

This file acts as a trigger for activating maintenance mode. You can create it using a text editor or the File Manager in your hosting control panel.

Step 6: Set Maintenance Mode Parameters

Inside the .maintenance file, insert the following code:

<?php $upgrading = time(); ?>

This code sets the maintenance mode timestamp to the current time, indicating that your website is undergoing updates.

Step 7: Test Maintenance Mode

To ensure that maintenance mode is working correctly, open your website in a different browser tab or using a separate device.

You should see the custom maintenance page you uploaded earlier. To access your site during maintenance mode, log in to your WordPress dashboard using an administrator account.

Step 8: Disable Maintenance Mode

Once you’ve completed your updates and improvements, delete the .maintenance file from your WordPress root directory. This deactivates the maintenance mode and makes your website accessible to all visitors again.

Final Note

Implementing WordPress maintenance mode without a plugin is a straightforward process that allows you to optimize your website for updates and improvements.

By following this step-by-step guide, you can seamlessly perform maintenance tasks while keeping your visitors informed and engaged.

Remember to back up your website, create a custom maintenance page, and follow the instructions to set up and disable maintenance mode effectively.

By optimizing your WordPress website for updates, you ensure a smooth user experience and contribute to its overall success.


Source link