How to hide a field of the editor by default

Here are a couple options.

You could just create a stylesheet that loads in the admin area, and enable that for certain users if needed. Here is an example of loading a stylesheet in the admin for users with the role of “shopmanager”.

function my_admin_styles(){
    $user = wp_get_current_user();

    if( ! empty($user) && count(array_intersect(["shop_manager"], (array) $user->roles ))) {
        wp_enqueue_style(
            'admin_css', 
            get_stylesheet_directory_uri() . '/css/admin-shopmanager.css', array(), filemtime( get_stylesheet_directory() . '/css/admin-shopmanager.css') 
        );
    }
}

add_action('admin_enqueue_scripts', 'my_admin_styles');

Then in your stylesheet add something like this…

#elementID {
    display: none !important;
}

You might also try a plugin called “Capability Manager Enhanced” which allows you to disable things based on user role.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)