Redirecting Users To Bypass WordPress Dashboard
Once you’ve finished developing a site in WordPress, a sub-domain or a staging server, there will come a point in time wherein you have to migrate it to a live URL and sync the database. This can be such a tedious task, especially if you’re using plugins that don’t store data in the database.
With this simple snippet you’ll be able to grant your users access to the site without giving them access to the dashboard.
Simply just insert this short code (preferably at the top) in your index.php, home.php or custom front page and it will redirect non logged in users to a page called holding.php.
<?php /* Template Name: Custom Page */ if ( !is_user_logged_in()) { get_template_part('holding'); exit(0); } get_header(); ?>