Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is there an easy way to create an admin user that has read only permissions? That is, they can login and see everything an admin can, but they cannot change anything at all.

share|improve this question
add comment

2 Answers

Is there an easy way...

AFAIK, no, not at all.

If using a single site installation, you'd need to carefully disable (not hide, disable) all possible user actions that modify things. And this has to be done screen by screen (Posts, Pages, Comments, Appearance, Plugins, etc).

For example, in the All Posts screen (/wp-admin/edit.php):

/**
 * Remove all row actions Edit|Quick Edit|Trash|View
 */
add_filter( 'post_row_actions', 'wpse_56560_remove_row_actions', 10, 2 );    
function wpse_56560_remove_row_actions( $actions, $post ) 
{
    global $current_user;
    if( 'pseudo-admin' == $current_user->user_login )
        return array();

    return $actions; 
}

/**
 * Remove the Trash link from All|Published|Trash
 */
add_filter( 'views_edit-post', 'wpse_74488_remove_trash_link' );   
function wpse_74488_remove_trash_link( $views ) 
{
    global $current_user;
    if( 'pseudo-admin' == $current_user->user_login )
        unset( $views['trash'] );

    return $views;
}

In the Post Edit screen (/wp-admin/post.php?post=ID&action=edit):

/**
 * Remove the Publish meta box
 */
add_action( 'do_meta_boxes', 'wpse33063_remove_meta_box' );
function wpse33063_remove_meta_box()
{
    global $current_user;
    if( 'pseudo-admin' == $current_user->user_login )
        remove_meta_box( 'submitdiv', 'post', 'side' );
}

In the previous examples, all function names contain the ID of the WPSE Question where they were taken from.

Also, refer to this Gist to see how to redirect users if they try to access a page using a direct URL.


If using a Multisite installation, @BrianFegter Answer to this Question: How can I open up my administrative panel to everyone?, has this nice suggestion:

I would use WP Multisite and allow users to register a test site. Woo Themes does this with their playground feature.

share|improve this answer
add comment

May be adminimize plugin can help you. http://wordpress.org/extend/plugins/adminimize/ it allows to set/controll users permissions.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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