While Pressable does not currently offer a direct option to password protect an entire site through the MyPressable control panel, there are several effective methods you can use to restrict access to your WordPress site.
Each option below will work on both staging and live sites, but our recommendations vary slightly based on site type since the expected traffic differs.
For Staging Sites: Maintenance Mode
If you are working on a staging site and want to prevent public access while allowing administrators to view and work on it, Pressableโs built-in Maintenance Mode is often the best solution.
When Maintenance Mode is active:
- Regular visitors will see a maintenance screen.
- Users logged into WordPress with an administrative account will bypass the maintenance screen and see the site as usual.
This allows you and your team to continue development and testing without exposing the site to the public.
For detailed instructions on how to enable this feature, please see our article: WordPress Maintenance Mode.
For Live Sites: Using Plugins or Custom Code
For live sites where you need to restrict access, here are a couple of options:
Option 1: WordPress Plugins (Recommended for Simplicity)
The simplest way to password protect your live WordPress site is by using a plugin. Several plugins are available that can add site-wide password protection or protect specific pages or posts. Here are a couple of popular options:
- Password Protected: This plugin allows you to quickly password protect your entire WordPress site with a single password.
Find it here: https://wordpress.org/plugins/password-protected/ - Password Protect Page: If you only need to protect specific content rather than the entire site, this plugin offers more granular control.
Find it here: https://wordpress.org/plugins/password-protect-page/
To use these plugins, install and activate them through your WordPress dashboard, then follow their specific configuration instructions.
Option 2: Custom PHP Redirects (For Technical Users)
More technically advanced users can implement password protection logic using a custom-redirects.php file. This method involves adding custom PHP code to handle authentication before allowing access to the site.
You can learn more about implementing custom redirects here: Adding Custom Redirects with PHP.
Please note: Pressable does not provide sample code for custom authentication logic in our public documentation. Sharing such code could potentially make it easier for unauthorized parties to figure out methods to bypass the protection. If you choose this method, you will need to develop or source the authentication script independently.
If you have any questions about these methods or need further assistance, please don’t hesitate to contact our support team.