Kode berikut ini dapat membatasi akses pengguna selain editor dan admin ke wilayah wp-admin.
function restrict_admin() {sumber: http://wordpress.stackexchange.com
if (!current_user_can('edit_others_posts')) {
wp_die(__('You are not allowed to access this part of the site'));
}
}
add_action('admin_init', 'restrict_admin', 1);