Remove Page and Post Write Panel Features

Ever heard of Custom Write Panels? Basically, you can add or remove meta boxes (a.k.a. writing ‘features’) for different post types. For example, with the powerful CustomPress plugin (as with some other custom post type tools), you have these feature options:

custom write panel options for WPMU DEV CustomPress plugin

But what about the ‘post’ and ‘page’ post types that ship with WordPress? What if you want to customize which meta boxes are displayed when writing posts and pages?

We can use the remove_post_type_support function to remove meta boxes even for Posts and Pages.

Featured Plugin - WordPress Appointments Plugin

Take, set and manage appointments and client bookings without having to leave WordPress. Appointments+ makes it easy.
Find out more

Code Snippets

Contributors can write posts but not add Featured Images

Contributors cannot Publish posts. They can only click the Submit for Review button. So Editors can add a featured image to these posts, and Authors can add their own featured images.

1
2
3
4
5
6
7
8
9
10
11
add_action('admin_init', 'my_custom_write_panel');

function my_custom_write_panel() {

if ( !current_user_can( 'publish_posts' ) ) { // if user is a Contributor (since Subscribers cannot post at all)

remove_post_type_support( 'post', 'thumbnail' );

}

}

In the screenshot below, you can see the Featured Image option isn’t even available from the Screen Options menu and doesn’t display on the writing panel.

Hide Title Bar and Excerpt Box for users lower than Editor

Useful if you want your Contributors (cannot Publish posts; can only Submit for Review) to write the post and the Editors to create the post’s Title and Excerpt.

1
2
3
4
5
6
7
8
9
10
11
12
13
add_action('admin_init', 'my_custom_write_panel');

function my_custom_write_panel() {

if ( !current_user_can( 'delete_others_posts' ) ) { // if user is below Editor level

remove_post_type_support( 'post', 'title' );

remove_post_type_support( 'post', 'excerpt' );

}

}

Disable Editor / Content area for Administrators on both Posts and Pages

Useful in setups that adhere to the practice that Administrator accounts shouldn’t be used for writing, only administering the site. Obviously, as an Administrator, they could override this code, but it’s more of a reminder, “Hey, you’re logged in as the admin; write under your Author or Editor account instead.” But if the admin gets a blog post idea, they could at least create a draft with a descriptive title.

1
2
3
4
5
6
7
8
9
10
11
12
13
add_action('admin_init', 'my_custom_write_panel');

function my_custom_write_panel() {

if ( current_user_can( 'manage_options' ) ) { // if user is Administrator

remove_post_type_support( 'post', 'editor' );

remove_post_type_support( 'page', 'editor' );

}

}

For Your Reference

I’m sure you can come up with a variety of use cases for remove_post_type_support. It can help enforce workflow policies by disabling features for certain user roles, or it can be used for de-cluttering options for less-savvy clients.

To be clear, these snippets only disable the feature’s display on the editor page. They do not modify any display on the front-end or in the database. For example, if you turn off the post’s content editor box, it won’t erase any post’s content; you just won’t be able to see it when editing in the wp-admin area.

Here are some links for your reference:

Featured Plugin - WordPress Infinite SEO Plugin

Fully integrated with the SEOMoz API, complete with automatic links, sitemaps and SEO optimization of your WordPress setup - this is the only plugin you need to help you rank your site number 1 on Google - nothing else compares.
Find out more

Participate