How can I remove website fields from Add User Page in wordpress admin panel?

Its getting impossible for me now to remove website field from wordpress dashboard Add User page. Someone please suggest something??

Related posts

Leave a Reply

6 comments

  1. Maybe this can help you:

    function hide_website_krotedev(){
      echo "n" . '<script type="text/javascript">jQuery(document).ready(function($) {
        $('label[for=url], input#url').hide();
      }); 
      </script>' . "n";
    }
    add_action('admin_head','hide_website_krotedev');
    
  2. If you want to remove the Twitter field in the user profile then you should add the following code to your functions.php file.

    function modify_contact_methods($profile_fields) {
    
    
        // Remove profile fields
        unset($profile_fields['twitter']);
    
        return $profile_fields;
    }
    add_filter('user_contactmethods', 'modify_contact_methods',10,1);
    

    Unfortunately there’s no easy way to remove the Website field at this time, you can always hide it with jQuery but that’s a bit messy of course.

    I hope that helps, also check out the stackexchange website for WordPress questions here: http://wordpress.stackexchange.com

  3. The User profile Website field seems to be hard-coded in user-edit.php, so you shouldn’t remove it. But you can hide it with CSS. Add this code to your functions.php file:

    function remove_website_row_wpse_94963_css()
    {
        echo '<style>tr.user-url-wrap{ display: none; }</style>';
    }
    add_action( 'admin_head-user-edit.php', 'remove_website_row_wpse_94963_css' );
    add_action( 'admin_head-profile.php',   'remove_website_row_wpse_94963_css' );
    
  4. I changed kroteDev’s answer to instead hide the row rather than the individual fields.

    function hide_website_field(){
        // Hide the website field on the admin Add New User form
        echo "n" . '<script type="text/javascript">jQuery(document).ready(function($) {
            $('label[for=url]').parent().parent().hide();
        }); 
        </script>' . "n";
    }
    add_action('admin_head','hide_website_field');
    
  5. The following code can be used to remove the menu’s you add to the $restricted array.

    function remove_menus () {
    global $menu;
    $restricted = array(__('Dashboard'), __('Posts'), __('Media'), __('Links'), __('Pages'), __('Appearance'), __('Tools'), __('Users'), __('Settings'), __('Comments'), __('Plugins'));
    end ($menu);
    while (prev($menu)){
        $value = explode(' ',$menu[key($menu)][0]);
        if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);}
    }
    }
      add_action('admin_menu', 'remove_menus');
    
  6. go wp-admin/user-edit.php

    comment this code

    <tr>
        <th><label for="url"><?php _e('Website') ?></label></th>
        <td><input type="text" name="url" id="url" value="<?php echo esc_attr($profileuser->user_url) ?>" class="regular-text code" /></td>
    </tr>