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%?
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%?
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.
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();
}
}
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.