WordPress.org

Ready to get started?Download WordPress

Forums

Remove Editor from Blog page (1 post)

  1. aeboi80
    Member
    Posted 1 year ago #

    I have a page called Blog with an ID of 5 I'm trying to remove the editor box when this page is edited in the WP Admin. This page is blank and only used to assign the page "Blog" as the slug for WP to use as the posts page. I have a page called "Home" which is the home page.

    Clients are getting confused as to why there is a page called "Blog" in the pages section of the admin and try to add text to it. I would just like to remove the editor box all together from this page to further prevent confusion. I tried using an action hook to do it, but its not working:

    /**
     * Hide Editor Box on Blog Page in WP Admin
     */
    add_action( 'load-edit.php', 'hide_blog_page_editor_09204483' );
    
    function hide_blog_page_editor_09204483()
    {
    
        // Check for post=5, if it is not this one, do nothing
        if( !isset( $_GET['post'] ) || '5' != $_GET['post'] ) // <--- adjust
            remove_post_type_support( 'post', 'editor' );
    }

    Any thoughts on this?

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic