0

If I create a page by default it has a page title and full WYSIWYG editor. I have created some custom fields using the custom fields plugin which gives you the option to hide certain things. If I select the checkbox to hide the WYSIWYG editor then it removes the default one but also removes all the custom fields I created too which is no good. Is there a way to just remove the default one?

I saw some examples of code to do this but my problem with those is that they rely on hard coding the page name. If the user were to change the page name then that code would break.

1 Answer 1

1

WordPress has the remove_post_type_support function that can be used with this purpouse, you can learn more from https://developer.wordpress.org/reference/functions/remove_post_type_support/

Just an example borrowed from codex

/**
 * Remove excerpt support from posts.
 */
function wprocs_custom_init() {
    remove_post_type_support( 'post', 'excerpt' );
}
add_action( 'init', 'wpdocs_custom_init' );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.