WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/remove post type support

Description

Remove support of certain features for a given post type (s). All features are directly associated with a functional area of the edit screen, such as the editor or a meta box. Additionally, the 'revisions' feature dictates whether the post type will store revisions, and the 'comments' feature dictates whether the comments count will show on the edit screen.

Typically remove_post_type_support() should be attached to the 'init' action hook.

Usage

<?php remove_post_type_support$post_type$supports ?>

Parameters

$post_type
(string) (required) Post type. (max. 20 characters)
Default: None
$supports
(string) (required) Feature to remove.
Default: None
  • 'title'
  • 'editor' (content)
  • 'author'
  • 'thumbnail' (featured image) (current theme must also support Post Thumbnails)
  • 'excerpt'
  • 'trackbacks'
  • 'custom-fields'
  • 'comments' (also will see comment count balloon on edit screen)
  • 'revisions' (will store revisions)
  • 'page-attributes' (template and menu order) (hierarchical must be true)
  • 'post-formats' removes post formats, see Post Formats

Examples

Remove support for excerpts

This example removes support for excerpts in posts:

add_action( 'init', 'my_custom_init' );
function my_custom_init() {
	remove_post_type_support( 'post', 'excerpt' );
}

Remove support for post formats

This example removes support for post formats in posts:

add_action( 'init', 'my_remove_post_type_support', 10 );
function my_remove_post_type_support() {
    remove_post_type_support( 'post', 'post-formats' );
}

Change Log

Source File

remove_post_type_support() is located in wp-includes/post.php.

Related

Post Types: register_post_type(), add_post_type_support(), remove_post_type_support(), post_type_supports(), post_type_exists(), set_post_type(), get_post_type(), get_post_types(), get_post_type_object(), get_post_type_capabilities(), get_post_type_labels(), is_post_type_hierarchical(), is_post_type_archive(), post_type_archive_title()

See also index of Function Reference and index of Template Tags.