I’m setting up a simple web site for a member of my family, using wordpress as a CMS. I’ve already registered a domain name and I’m about to set up wordpress. I want them to be able to edit the site content online (using wordpress’s admin interface) and view the site, but I don’t want the site to be available to the public while it’s in the editing stages.
Can anyone suggest a good way to prevent access to the public (for example a “coming soon” page, but access to the main site via a password; or perhaps put the wordpress installation in a subdirectory while the site is in the editing stages, and then use url rewriting to redirect the root directory to the subdirectory when the site goes live).
I should mention that I’m relatively new to wordpress, so if this kind of functionality is built in I apologise for asking the question.
I also have had problems with the maintenance plugins. What you can do instead (if you are familiar with HTML) is create a simple “Closed for Maintenance” page. Save the page as xindex.html. Upload the xindex.page to the same directory as your WordPress installation.
You WordPress installation comes with two files index.html and index.php. While you are working or doing maintenance to your site, first rename the existing index.html file as realindex.html then rename the xindex.html that you uploaded as index.html. This will replace the WordPress homepage with your maintenance page.
When you are finished working and are ready to display your site, reverse your steps. Rename the current index.html back to xindex.html and change realindex.html back to index.html. Sounds more complex than it is in practice, but it entirely avoids buggy plugins.
Here’s a link to my maintenance page. You can copy the source.
Closed for Maintenance
If you know how to, just set up apache basic authentication – this will give you a little dialog box that asks for a username and password.
The main advantage is that you don’t need to change your WP setup, and any authorised user can see the front end. Once you’re ready, turn it off, and you’re good to go
There is number of plugins that show up maintenance pages, but I personally had trouble with that (plugin conflicted badly with something and almost knocked out server) and stay away from those since.
My personal preference is Members plugin, it has (among other things) easy to use private mode that will prompt for WordPress login to see anything on site.
I’d stay away from redirects for something simple, it is always better to develop as close to final URL structure as possible.
or you can put this AS THE FIRST THING in your wp-config:
You could also simply enable the WordPress privacy setting to block search engines. If this is a new site with no links from other sites, nobody would be able to find it in the first place (unless they knew the specific URL). Admittedly, this isn’t really “hiding” the content per se, since anyone can visit the site and see the content, but if people can’t find it in the first place, that’s kind of the same thing, right?
(The “Site Visibility” setting is under Settings > Privacy Settings.)
Another simple answer is to write a “coming soon” page or whatever you want, and then name that file home.php. Drop this file into your theme and WordPress will automatically make this your home page. Your WordPress pages are still accessible to anyone who knows the right URLs. When you’re done setting up, just delete this file.
Note, this only works if you HAVEN’T set a static home page under Settings -> Reading.
I would also “hide” the site from search engines under Settings -> Privacy. WP reminds you that search engines are blocked, so just unblock after you’re through constructing the site.