In my WordPress installation (4.9.8.) the editor role isn't allowed to edit the privacy page.

It would work with following in my functions.php:

$role_object = get_role( 'editor' );
$role_object->add_cap( 'manage_privacy_options', true );
$role_object->add_cap( 'manage_options' ); // this needs to be active in order that before cap works

But now the editor has lot more rights than just editing the privacy page.

Is there another way to grant access to the editor user role with some lines of PHP code?

As a workaround I make usage of this Plugin now: https://wordpress.org/plugins/manage-privacy-options/

Another kind of workaround is just to choose no privacy page in the privacy settings.


Editing the privacy policy page is restricted to manage_privacy_options as pointed out in a comment in the WordPress core file wp-includes/capabilities.php:

 * Setting the privacy policy page requires `manage_privacy_options`,
 * so editing it should require that too.
if ( (int) get_option( 'wp_page_for_privacy_policy' ) === $post->ID ) {
  $caps = array_merge( $caps, map_meta_cap( 'manage_privacy_options', $user_id ) );

To allow users with the roles editor and administrator (in single and also multisite instances) to edit and delete the privacy policy page one has to overwrite the $caps array:

add_action('map_meta_cap', 'custom_manage_privacy_options', 1, 4);
function custom_manage_privacy_options($caps, $cap, $user_id, $args)
  if ('manage_privacy_options' === $cap) {
    $manage_name = is_multisite() ? 'manage_network' : 'manage_options';
    $caps = array_diff($caps, [ $manage_name ]);
  return $caps;
  • oh looks very clever.. 1. does $caps = array_diff($caps, [ $manage_name ]); restrict all other cap's of manage_options ? and just allow to edit the privacy options? 2. the administrator would not need this really, as this cap already in, or? – André Kelling Jan 17 at 9:00
  • @AndréKelling 1. The hook map_meta_cap is working on a per-post basis. No other post has the restriction manage_privacy_options so it should be fine to remove it. More information here. 2. In WordPress multisite environments only super-administrators are allowed to edit the privacy policy page. As you mentioned, this is not relevant for single page installations. – Sven Jan 17 at 12:42
  • @AndréKelling Do you have any further questions regarding my answer? If not, please accept the answer to mark this question as solved :) – Sven Mar 4 at 13:01
  • 1
    no sorry, couldn't find the time to check this. will do immediately! – André Kelling Mar 4 at 14:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.