I got a requirement (CRM system) and it can be developed using WordPress back-end.

So I don’t need front-end 100%.

Is there way to disable the front-end 100%?

1 Answer
1

By Killing WP on non-admin Pages

The below code will determine whether you are on a front-end page or not, and kill WP if you are.

add_action( 'init', 'my_function' );

function my_function(){
    if ( ! is_admin() ) wp_die();
}

Note that this might also affect AJAX requests ( untested ) so you might want to add wp_doing_ajax() to your conditional too.

By Redirecting the Users to Dashboard

Same as above, you can check if you are on admin and redirect the users to back-end from front-end.

add_action( 'init', 'my_function' );

function my_function(){
    if ( ! is_admin() ) {
        wp_safe_redirect( admin_url() );
        exit();
    }
}

By Creating an Empty Theme

Create a blank theme, and only add index.php and style.css as its content. Now you can activate the theme, and everyone visiting the front-end will be getting a white page.

Leave a Reply

Your email address will not be published. Required fields are marked *