How to enable revisions for custom post type in WordPress?

Posted by Editorial Staff | Updated on

If you want to enable revisions for your custom post type then you have to add the following code to the functions.php file of your current activated WordPress theme.

When you register your CPT, you need to manually add support for revisions. Only title and editor are set as defaults. Check out the codex. So if you need to enable revisions, you need to add it like this

'supports' => array( 'title', 'editor', 'revisions' ),

in your $args = array() when registering your CPT.

Just for info, here are the other arguments you can pass to ‘supports’

Reference: https://wordpress.stackexchange.com/questions/139031/enable-revisions-for-custom-post-type


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers