# Add Excerpts, Revisions and More to Any Post Type

> Switches on editor features such as excerpts, revisions, page attributes or custom fields for post types that were registered without them.

- Type: PHP
- Runs: Run everywhere
- Category: [Custom Post Types & Fields](https://wpide.com/library/category/post-types/)
- Tags: custom-post-types, editor, supports
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/add-post-type-supports/

## Code

```php
// Post type => features to add.
$wpide_add_supports = array(
    'page'      => array( 'excerpt' ),
    'portfolio' => array( 'revisions', 'excerpt', 'page-attributes' ),
);

add_action( 'init', function () use ( $wpide_add_supports ) {
    foreach ( $wpide_add_supports as $type => $features ) {
        if ( post_type_exists( $type ) ) {
            add_post_type_support( $type, $features );
        }
    }
}, 99 );
```

## Notes

Feature names: title, editor, author, thumbnail, excerpt, comments, revisions, page-attributes, custom-fields.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Add Excerpts, Revisions and More to Any Post Type" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
