• Resolved nevatonight

    (@nevatonight)


    Hello,
    How can I disable both the visual and classic editor?

    There was a similar topic earlier, where the problem was solved by adding the following code:

    add_action('init', 'my_remove_editor_from_post_type');
    function my_remove_editor_from_post_type() {
    remove_post_type_support( 'post', 'editor' );
    remove_post_type_support( 'page', 'editor' );

    }

    Unfortunately, it’s no longer helping with this issue.

    I’ve been able to disable the visual editor by adding the following code to functions.php:

    add_filter( 'user_can_richedit' , '__return_false', 50 );

    Please tell me how I can disable the classic editor too. I don’t want users to be able to add html code and images, so I want to keep only regular text forms.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Your remove post type support code works correctly on my WP installation. Apparently your theme or a plugin is preventing it from working for you as desired. Perhaps try adding your action hook with a large $priority arg so your code will more likely have the final say in the matter:
    add_action('init', 'my_remove_editor_from_post_type', 9999 );

    Or selectively switch themes and deactivate plugins to identify which is interfering. Take up the issue with the responsible module’s developer.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.