@yliya14
2 years, 3 months ago
`function wph_noadmin() { if (is_admin() && !current_user_can(‘administrator’)) { wp_redirect(home_url()); exit; } } add_action(‘init’, ‘wph_noadmin’);
Add this code to function.php The code redirects all users except the administrator to the main page of the site when they try to login to the admin panel