0

I have a page created in wordpress that I want to redirect all users to. Ex.: www.mywordpress.com/offline

How can I direct all traffic requests (except wp-admin and dashboard) to this page?

My goal is to have an offline page for when I am working on things or I am not accepting any new business.

0

Check this plugin - https://wordpress.org/plugins/jf3-maintenance-mode/

This plugin is intended primarily for designers / developers that need to allow clients to preview sites before being available to the general public or to temporarily hide your WordPress site while undergoing major updates.

0

You can use template_redirect action for redirect all user to specific page. paste this code in functions.php of active theme and just change page slug offline with your page slug where you want to redirect. when non logged user visit any page of site it will redirect to specific page.

add_action( 'template_redirect', 'redirect_to_specific_page' );
function redirect_to_specific_page() {
    if ( !is_page('offline') && ! is_user_logged_in() ) {
        wp_redirect( home_url()."/offline/" ); 
        exit();
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.