Title

PHP Posts & Pages, disable things

description

How to disable the default WP editor from posts and pages, to induce custom post behavior, replace with ACF fields or force editing with Elementor.

Published 2022-05-12

Modified 2022-08-19

content

				
					add_action( 'init', function() {
    remove_post_type_support( 'post', 'editor' );
    remove_post_type_support( 'movies', 'editor' );
    remove_post_type_support( 'page', 'editor' );
}, 99);
				
			

Possible values of parameter $feature

  • ‘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,