Hiding or Removing Options on Post and Page Screen

Week before last, I shared a how you can hide certain menu links in WordPress from some clients’ users so they won’t get confused with all the options. Sometimes, that alone is not enough because there are areas on the post and edit screens itself you’d like to hide. This is how you’d get that done.

Screen Options

This is the easiest way. It doesn’t require any coding at all. Simply log on as the user you’d like to hide the elements from, go Add New post or edit an existing post. Click on the Screen Options tab to drop the panel.

Uncheck the items you want to hide.

Pretty much every screen in WordPress has Screen Options some screens don’t have much to them to customize. However, you’ll want to check under Menus, Media Library, Links and Pages.

The bad: It’s not a safe locking mechanism. If your user eventually clicks on the Screen Options drop down, they can learn to re-enable these options. Chances of that happening depends on how technically adventurous they are. I’d say it is low unless you show them how. Even most seasoned WordPress users tend to ignore Screen Options. It’s not something that’s used a lot.

However, you’ll want to be prepared when the client figures it out and starts asking questions.

Functions.php

I love the functions.php file. there’s just so much you can do with it and among them is to pop the following codes in there. Add and/or remove each option as you deem fit.
// REMOVE OPTIONS FROM POSTS SCREEN
function remove_post_screen_options() {
remove_meta_box( 'postcustom','post','normal' ); // Custom Fields
remove_meta_box( 'postexcerpt','post','normal' ); // Excerpt
remove_meta_box( 'commentstatusdiv','post','normal' ); // Comments
remove_meta_box( 'trackbacksdiv','post','normal' ); // Trackbacks
remove_meta_box( 'slugdiv','post','normal' ); // Slug
remove_meta_box( 'authordiv','post','normal' ); // Author
}
add_action('admin_menu','remove_post_screen_options');

// REMOVE OPTIONS FROM PAGES SCREEN
function remove_page_screen_options() {
remove_meta_box( 'postcustom','page','normal' ); // Custom Fields
remove_meta_box( 'postexcerpt','page','normal' ); // Excerpt
remove_meta_box( 'commentstatusdiv','page','normal' ); // Comments
remove_meta_box( 'trackbacksdiv','page','normal' ); // Talkback
remove_meta_box( 'slugdiv','page','normal' ); // Slug
remove_meta_box( 'authordiv','page','normal' ); // Author
}
add_action('admin_menu','remove_page_screen_options');

If these simply won’t work, there’s always plugins. Better yet, if you need the client to consistently post certain types of information and they be formatted in a particular way e.g. Product listings, recipes. Use custom post types.

Code source: WordPress Answers

Do You Want A Hands-Free Business?

Then get this guide to help you systemize your business so you'll have more time working on your business.

!
!

Hey! I want to make sure you know what you're getting here. In addition to the guide, you will also receive our memo that includes special offers, announcements and of course actionable information.

Terms and Conditions checkbox is required.
Something went wrong. Please check your entries and try again.
Facebook Comments