When creating a new website on the WordPress platform, we often want to see what our website will look like before the official launch. There are several methods that allow you to preview a page offline or as a draft without making it publicly available yet. Here are some best practices that will allow you to preview your WordPress site.
1. Using a built-in WordPress feature: Preview feature
The easiest way to preview your page is to use WordPress' built-in preview feature. When editing a page or entry, there is a "Preview" button on the right side in the "Publish" block. Clicking on it will open your page in a new browser window, showing the current editing status.
2. Using the plugin: WP Maintenance Mode
The WP Maintenance Mode plugin allows you to keep your website in maintenance mode while allowing you to preview your site. After installing and activating the plugin, go to settings and activate maintenance mode. You can now work peacefully on the website, and all visitors will only see a message about the work. To preview the page, you must be logged in to your administrator account.
3. Edit the .htaccess file
It is also possible to block access to the site for all users except specific IP addresses. To do this, edit the .htaccess file by adding the following code:
order deny,allow deny from all allow from xx.xx.xx.xx
Where “xx.xx.xx.xx” is your IP address. Please note that this method requires caution as an error in the .htaccess file can completely prevent the site from functioning.
4. Plugin: Coming Soon Page, Under Construction & Maintenance Mode by SeedProd
This is another plugin that allows you to preview the page. After installing and activating the plugin, you can set up your own “Coming Soon” or “Under Construction” page, while you and other logged-in users with the appropriate permissions will be able to view the page in full.
Summary
The choice of method depends on your skills and needs. For beginner WordPress users, the easiest method is to use the built-in preview function or install one of the proposed plugins. For advanced users who are familiar with the WordPress source code, editing the .htaccess file may be a good solution. Remember to always back up your website before making any changes.