WordPress – Allow Editors to Manage Privacy Policy Page
By default WordPress only allows Administrators to edit the Privacy Policy page. This is intended as a protective measure to ensure only authorized people are managing that information. However, in cases where your client doesn’t want full WordPress admin access, this can be rather problematic. In this instance you can open up access to that page for editors.
Just drop the code below into your themes functions.php file.
/* ---------------------------------------------------------
Allow Editors to Manage Privacy Policy Page
---------------------------------------------------------- */
add_action('map_meta_cap', 'custom_manage_privacy_options', 1, 4);
function custom_manage_privacy_options($caps, $cap, $user_id, $args)
{
if (!is_user_logged_in()) return $caps;
$user_meta = get_userdata($user_id);
if (array_intersect(['editor', 'administrator'], $user_meta->roles)) {
if ('manage_privacy_options' === $cap) {
$manage_name = is_multisite() ? 'manage_network' : 'manage_options';
$caps = array_diff($caps, [ $manage_name ]);
}
}
return $caps;
}

Leave a Reply
Want to join the discussion?Feel free to contribute!