Remove Personal Options section from Profile

I want to hide/remove the Personal Options in the Your Profile (wp-admin/profile.php) admin page.

I am aware that solutions for this exist, but I they use jQuery to do hide this section. This works, but when a user has JavaScript disabled in their browser, it will show up again. Therefore it is not a proper way to remove Personal Options.

Read More

Is there a way to remove the Personal Options section from the HTML source of the page? This means no jQuery or CSS hacks, or core file modification.

Related posts

Leave a Reply

10 comments

  1. This should do the trick

    // removes the `profile.php` admin color scheme options
    remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
    
    if ( ! function_exists( 'cor_remove_personal_options' ) ) {
      /**
       * Removes the leftover 'Visual Editor', 'Keyboard Shortcuts' and 'Toolbar' options.
       */
      function cor_remove_personal_options( $subject ) {
        $subject = preg_replace( '#<h3>Personal Options</h3>.+?/table>#s', '', $subject, 1 );
        return $subject;
      }
    
      function cor_profile_subject_start() {
        ob_start( 'cor_remove_personal_options' );
      }
    
      function cor_profile_subject_end() {
        ob_end_flush();
      }
    }
    add_action( 'admin_head-profile.php', 'cor_profile_subject_start' );
    add_action( 'admin_footer-profile.php', 'cor_profile_subject_end' );
    

    Also, don’t forget to mark your previous questions as solved 🙂

  2. Accepted answer is not working with 4.8

    Here comes an up to date and simplified code that should work with any version:

            // removes admin color scheme options
    
            remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
    
            //Removes the leftover 'Visual Editor', 'Keyboard Shortcuts' and 'Toolbar' options.
    
            add_action( 'admin_head', function () {
    
                ob_start( function( $subject ) {
    
                    $subject = preg_replace( '#<h[0-9]>'.__("Personal Options").'</h[0-9]>.+?/table>#s', '', $subject, 1 );
                    return $subject;
                });
            });
    
            add_action( 'admin_footer', function(){
    
                ob_end_flush();
            });     
    
  3. Was just trying to figure this out and came across this answer. The above code by Cor van doesn’t work anymore, but with a slight change of the add_action, it can.

    All you need to do is change the last two lines from:

    add_action( 'admin_head-profile.php', 'cor_profile_subject_start' );
    add_action( 'admin_footer-profile.php', 'cor_profile_subject_end' );
    

    to

    add_action( 'admin_head-user-edit.php', 'cor_profile_subject_start' );
    add_action( 'admin_footer-user-edit.php', 'cor_profile_subject_end' );
    

    So, the final code would look something like:

    if ( ! function_exists( 'cor_remove_personal_options' ) ) {
      /**
       * Removes the leftover 'Visual Editor', 'Keyboard Shortcuts' and 'Toolbar' options.
       */
      function cor_remove_personal_options( $subject ) {
        $subject = preg_replace( '#<h3>Personal Options</h3>.+?/table>#s', '', $subject, 1 );
        return $subject;
      }
    
      function cor_profile_subject_start() {
        ob_start( 'cor_remove_personal_options' );
      }
    
      function cor_profile_subject_end() {
        ob_end_flush();
      }
    }
    add_action( 'admin_head-user-edit.php', 'cor_profile_subject_start' );
    add_action( 'admin_footer-user-edit.php', 'cor_profile_subject_end' );
    
  4. Thanks to the comment from @Per I got it working for 4.5.2

        // removes admin color scheme options
        remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
    
        if ( ! function_exists( 'cor_remove_personal_options' ) ) {
            /**
            * Removes the leftover 'Visual Editor', 'Keyboard Shortcuts' and 'Toolbar' options.
            */
            function cor_remove_personal_options( $subject ) {
                $subject = preg_replace( '#<h2>Personal Options</h2>.+?/table>#s', '', $subject, 1 );
                return $subject;
            }
    
            function cor_profile_subject_start() {
                ob_start( 'cor_remove_personal_options' );
            }
    
            function cor_profile_subject_end() {
                ob_end_flush();
            }
        }
        add_action( 'admin_head', 'cor_profile_subject_start' );
        add_action( 'admin_footer', 'cor_profile_subject_end' );`
    
  5. Update for 3.9, the following works:

    add_action( 'admin_head', 'cor_profile_subject_start' );
    add_action( 'admin_footer', 'cor_profile_subject_end' );
    
  6. Here’s my CSS solution, tested in WordPress 4.9.8

    remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
    add_action( 'admin_head', function(){
        ob_start(); ?>
        <style>
            #your-profile > h2,
            .user-rich-editing-wrap,
            .user-syntax-highlighting-wrap,
            .user-comment-shortcuts-wrap,
            .user-admin-bar-front-wrap {
                display: none;
            }
        </style>
        <?php ob_end_flush();
    });
    
  7. I just wanted to clarify that the code will not work for localized versions of WordPress, because of the hardcoded Personal Options string. I cannot think of any easy solution here, but suggestions are welcome.

    I would have added this as a comment, but I haven’t got enough reputation to add a comment.

    I also take this opportunity to re-paste the whole code updated for WordPress version 3.9.

    Here it is:

    // removes the `profile.php` admin color scheme options
    remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
    
    if ( ! function_exists( 'cor_remove_personal_options' ) ) {
      /**
       * Removes the leftover 'Visual Editor', 'Keyboard Shortcuts' and 'Toolbar' options.
       */
      function cor_remove_personal_options( $subject ) {
        $subject = preg_replace( '#<h3>Personal Options</h3>.+?/table>#s', '', $subject, 1 );
        return $subject;
      }
    
      function cor_profile_subject_start() {
        ob_start( 'cor_remove_personal_options' );
      }
    
      function cor_profile_subject_end() {
        ob_end_flush();
      }
    }
    add_action( 'admin_head', 'cor_profile_subject_start' );
    add_action( 'admin_footer', 'cor_profile_subject_end' );
    

    Again, if you know in advance what the language of your WP installation will be, change the Personal Options string to the localized version of your language, for example in Italian you will replace it with Impostazioni personali.

  8. By using

    $subject = preg_replace( '#<h3>'.__("Personal Options").'</h3>.+?/table>#s', '', $subject, 1 );
    

    in the cor_remove_personal_options function, it is localized as well.

  9. I´ve found this solution on: https://premium.wpmudev.org/blog/how-to-simplify-wordpress-profiles-by-removing-personal-options/?ptm=c&utm_expid=3606929-108.O6f5ypXuTg-XPCV9sY1yrw.2

    function hide_personal_options(){ 
        echo "n" . '<script type="text/javascript">jQuery(document).ready(function($) { 
        $('form#your-profile > h3:first').hide(); $('form#your-profile > 
        table:first').hide(); $('form#your-profile').show(); });</script>' . "n"; 
    } 
    add_action('admin_head','hide_personal_options');
    

    If you want to be more specific or remove more you should have a look over here: https://isabelcastillo.com/hide-personal-options-wordpress-admin-profile

    You can just add those lines into the function.

  10. I remove only title and use CSS to hide first table…

    For me, in 2023, this work:

     // removes admin color scheme options
        remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
    
        if ( ! function_exists( 'cor_remove_personal_options' ) ) {
            /**
            * Removes the leftover 'Visual Editor', 'Keyboard Shortcuts' and 'Toolbar' options.
            */
            function cor_remove_personal_options( $subject ) {
               $subject = preg_replace( '#<h[0-9]>'.__("Personal Options").'</h[0-9]>#s', '<style>#your-profile>.form-table {display:none} #your-profile>.form-table ~ .form-table {display:block}</style>', $subject, 1 );
                return $subject;
            }
    
            function cor_profile_subject_start() {
                ob_start( 'cor_remove_personal_options' );
            }
    
            function cor_profile_subject_end() {
                ob_end_flush();
            }
        }
        add_action( 'admin_head', 'cor_profile_subject_start' );
        add_action( 'admin_footer', 'cor_profile_subject_end' );