WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What I would like to know is if it is possible to disable the edit post function in wordpress based on User's roles. I try to explain better. Let's take an 'Editor' as role example: I would like Editors, Authors.... but NOT ADMIN to be able to write posts only using Custom Fields instead of the 'classic' built in edit post function of WordPress.

Is there anyone who knows how to do it (maybe it is only a sentence or 2 in functions.php) or who as/know a plugin that will let me do it?

Thank you very much!

share|improve this question
up vote 2 down vote accepted

You can remove post type support for the editor on a conditional basis. The following should work:

add_action( 'add_meta_boxes', 'wpse45113_remove_editor' );
function wpse45113_remove_editor() {
    // change the capability and post type to whatever is appropriate
    if ( ! current_user_can( 'install_plugins' ) )
        remove_post_type_support( 'post', 'editor' );

I'm using add_meta_boxes because it fires not too long before the editor is initialized, but there are a number of hooks that would also work. You can similarly only add the meta box with the custom fields for those users within the same if block.

share|improve this answer
You are absolutely the best! I'm going to create a simple plugin from your code. – maisdesign Mar 11 '12 at 15:08
  1. You'll maybe want to use some Plugin to add a Custom Post Type.
  2. Then you can take another plugin to add custom fields.
  3. Last but not least, you could use a plugin like Members to allow some roles access to the CPT or deny it.

I can't give you any other plugin recommendations, as it a) depends on your needs and b) I'm not that much on the repo and used to code stuff myself.

share|improve this answer
Thank you very much for your effort but @helenhousandi answer is better :P – maisdesign Mar 11 '12 at 15:09

Your Answer


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.