In our years of experience, we’ve helped many users migrate and maintain their websites. When doing this, we’ve always stressed the importance of enabling the read-only mode.
By freezing your site’s content, you can make sure that no one changes anything on your website, even if they normally have edit access.
This can help you avoid errors, conflicts, and confusion when you’re making changes to your website.
In this article, we will show you how you can put your WordPress site in a read only mode for site migrations and maintenance.
Why Put Your WordPress Site in a Read Only State for Site Migrations and Maintenance
You can tweak a lot of settings on your WordPress website without stopping visitors from accessing the site. However, when you’re making a big change to your website, it’s a good idea to put your site into a read only state.
For example, if you’re moving WordPress to a new host or server, upgrading to a new version of WordPress, or installing a new theme, then it can affect the user experience and stop your site from working normally.
Setting up read only mode can help you avoid losing any data or content that’s added to your site while you’re making the change. You also prevent frustration from a poor user experience when features don’t work right.
For example, if someone is writing a new post in the WordPress dashboard while you’re migrating to a new server, then all of their hard work may be lost. Or perhaps a user can’t add products to their cart or checkout, so they leave your site.
That said, let’s take a look at the best way to put your WordPress site in read-only mode to prevent those issues.
How to Put Your WordPress Site in a Read Only State for Site Migrations and Maintenance
There are a few dedicated content freeze or read-only mode plugins available, but they are all currently outdated and not actively maintained by their developers.
That’s why we recommend using the Lock User Account plugin instead.
This is perfect for membership sites, online stores, or any other type of site that allows user registration.
This plugin lets you temporarily lock any user out of their WordPress account. Anyone who is locked out of their account won’t be able to edit the site’s content or add any new content, although visitors will still be able to see the website.
If a user tries to log into a locked account, then they’ll see a message simply stating ‘Your account has been locked.’ You can customize this message to give your users more information.
Now, using this plugin doesn’t actually freeze your site or prevent database changes. That’s why we also recommend temporarily disabling your comments and any contact forms on your site as well. We’ll show you how to do that below.
First, you’ll need to install and activate the Lock User Account plugin. If you need help, then please see our guide on how to install a WordPress plugin.
Before starting the content freeze, you can change the message that users will see if they try to log into a locked account. For example, you might want to explain that you’re changing your domain name or doing essential maintenance.
To change the default ‘Your account has been locked’ error message, simply head over to Settings » General.
Towards the bottom of the screen, you’ll see a new ‘Lock User Account’ section.
You can now simply type a new message into the ‘Locked User Message’ field. Once you’re happy with the message, just click on the ‘Save Changes’ button.
After that, you’re ready to put your site into read-only mode.
To go ahead and start locking users out of their accounts, head over to Users » All Users.
On this screen, you’ll see all the people who have an account on the site.
The ‘Locked’ column shows whether each user currently has access to their account (unlocked) or not (locked).
To temporarily lock a user out of their account, click the checkbox next to their profile picture.
If you want to lock multiple people out of their accounts, then click to select multiple boxes.
Note: It’s very important to make sure you leave your own user account unlocked. If you accidentally get locked out, see our guide on how to deactivate all plugins without wp-admin access so you can deactivate the Lock User Account plugin from your WordPress hosting panel.
After selecting one or more usernames, click on the ‘Bulk actions’ dropdown and then select ‘Lock.’
When you’re ready to lock these people out of their accounts, click the ‘Apply’ button.
Now, the site is essentially in read only mode for your users, and if anyone with a locked account who tries to log in will get an error message.
Once you’ve finished your work, you can unlock the user accounts. Simply go back to Users » All Users and repeat the process above. Only this time, be sure to select ‘Unlock’ from the ‘Bulk Actions’ dropdown.
After that, you can click the ‘Apply’ button to reactivate these accounts.
How to Temporarily Disable Comments and Form Entries
Before you start your site migration or other big changes, you’ll also want to temporarily disable comments and form entries on your site. If someone submits a comment or form in the middle of your changes, that data would be lost.
To temporarily disable comments quickly and easily on your whole site, we recommend using WPCode.
Simply install and activate the free WPCode snippets plugin and then navigate to Code Snippets » Add Snippet.
From here, you can click on the Comments category in the left menu and then click on ‘Use snippet’ under ‘Completely Disable Comments’.
On the next screen, all you need to do is set the toggle from Inactive to Active.
Then, click the Update button, and your snippet will be live.
If you’d prefer to disable comments manually without a plugin, you can see our step by step guide on how to completely disable comments in WordPress.
We also recommend temporarily disabling any contact forms or other forms on your website. You can simply remove the form and replace it with your business email address temporarily so that you don’t miss out on any important messages.
At this point, you are ready to migrate your site or do essential maintenance work without worrying about conflicts and errors.
BONUS: How to Create Beautiful Maintenance Pages in WordPress
In addition to locking user accounts and securing forms and comments, you can also put your site into maintenance mode, so no one can access the primary content.
A well-designed maintenance page can explain exactly why your site is in a read-only state and when visitors can expect it to come back online.
This is where SeedProd comes in. It is the best drag-and-drop page builder for WordPress, and it allows you to create a completely custom maintenance page.
You can use the free version of SeedProd to create a beautiful maintenance mode page.
For more details, you can see our guide on how to put your WordPress site in maintenance mode.
We hope this article helped you learn how to put your WordPress site in read only mode for site migrations and maintenance. You can also go through our guide on the fix briefly unavailable for schedule maintenance in WordPress and how to allow user registration on your WordPress site.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
Moinuddin Waheed
to be honest, I didn’t know that such things also exist that we can have migration without affecting the users ability to see and read the blogs and content.
I have always used under construction and coming soon landing pages. But it is good to have such ways to update and migrate for websites having subscription mode and other similar nature.
Thanks for this guide.
Jiří Vaněk
I use the ‘Under Construction’ plugin for this purpose. Does this method have any benefits other than making the website visible? And couldn’t it be counterproductive compared to the method of hiding everything behind a paragraph information in case something goes wrong?
WPBeginner Support
This would be for sites with multiple authors to prevent someone from creating a draft or making a modification while a site is being migrated, you can use a coming soon page with this if you wanted for your site visitors.
Admin
Mark Conger
Note that Code Freeze has been abandoned, it seems. But it has been forked and can found on github.
Anonymous
So how about the FILE WRITE permissions? Let’s say the WP site is under attack, then how do i lock the any WRITES to the file systems?
Kevin
Thanks for writing on this plugin. I wondered if such a thing would be generally useful and I’m glad to see that, even if its use remains rather niche, it is useful to some people.