• Sales: +34 686 699 630
  • Sales/Support: hello@jucra.com
  • Client Portal
  • Webmail Login
  • Knowledge Base
  • Uptime Monitor
  • Our Blog
  • Zoho Assist
Digital Agency in Marbella
  • Home
  • Web Design
    • Web Site Design
    • Website Care Plans
    • One Time Jobs
    • Bulk Prepaid Hours
  • Web Hosting
    • Managed Cpanel Web Hosting
    • Managed DNS Hosting
    • Hosted Email
  • Contact Us

Customising the WordPress User Profile Page without plugins

by craigedmonds | 18 Apr, 2020 | How To

The WordPress user profile page with the admin comes with ALOT of extra garbage which is not really needed, especially if you have a client who is easily confused. We wanted our client to easily add and manage their users without resorting to plugins or having to train the client on navigating the minefield of the default user profile page.

Yes, there are a few plugins you can use to customise the user profile page, however, with plugins comes “code bloat” so the functions at the bottom of the page are what we use to do the following:

  1. Clean up the User profile page
  2. Set the default user role when adding a new user
  3. Disable the “send email to new user” tickbox


BONUS: I know we said code = bloat but we do actually use the ACF Pro plugin to manage custom fields, it’s the easiest way to get custom fields into any post including the user editing section and provides a wide array of flexibility.

Moving on, let’s look at the profile page BEFORE we apply 3 simple functions.

Before Applying Functions

As you can see there is A LOT of stuff our client does not need to see when he adds/edits a new user to his WordPress.

After Applying Functions

Now you can see that the add user screen holds minimal information and much clearer and tidier to the end user.

What functions did we use for this?

The following code just needs to be added to your functions.php for your current theme and the whole page will be cleared up.

Here is the code

Literally drop the code into the theme functions.php and your user profile page will be cleared up.  The only thing you need to do in order to set the default user role on create user, is to enter your default user role. For the profile section, you can add/remove class or ID items to the jquery. For example we are hiding the Yoast stuff as well as other items.

PHP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
##################################
//programmatically set default role for new users
##################################
add_filter('pre_option_default_role', function($default_role){
    return 'YOUR_DEFAUL_USERROLE';
    return $default_role; //
});
 
##################################
//untick the send the new user and email
##################################
add_action( 'user_new_form', 'dontchecknotify_register_form' );
function dontchecknotify_register_form() {
    echo '<scr'.'ipt>jQuery(document).ready(function($) {
        $("#send_user_notification").removeAttr("checked");
    } ); </scr'.'ipt>';
}
 
##################################
//remove messy profile section items
##################################
if( is_admin() ){
    remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
    add_action( 'personal_options', 'prefix_hide_personal_options' );
}
 
function prefix_hide_personal_options() {
  ?>
    <script type="text/javascript">
        jQuery( document ).ready(function( $ ){
            $( '#your-profile .form-table:first, #your-profile h3:first, .yoast, .user-description-wrap, .user-profile-picture, h2, .user-pinterest-wrap, .user-myspace-wrap, .user-soundcloud-wrap, .user-tumblr-wrap, .user-wikipedia-wrap' ).remove();
        } );
    </script>
  <?php
}

BONUS: Showing the custom fields in profile page

Below is a screenshot of how we get the extra profile fields onto the user profile page.

Craig Edmonds

Post Written by Craig Edmonds

Craig is one of the owners of JUCRA Digital and reigns from a hospitality and finance background, however, fell into web design and development in 2000 after leaving the world of finance to go on a sabbatical in Marbella, Spain where he has been ever since. Craig really loves the challenge of the internet, digs WordPress and loves Cpanel.



View Craig's LinkedIN Profile

Posted in:
  • How To
Tags:
  • edit user profile pages
  • wordpress code tips

Contact Us

We will be very happy to hear from you to discuss your needs. Please use one of the methods below to contact us, or fill in our contact form here.

Tel: Schedule a sales call
Email: hello@jucra.com

  • Follow
  • Follow
  • Follow
  • Follow
View Customer Success Story Videos

Legal

Privacy Policy
90 Day Warranty
Payment Policy

Affiliates

Affiliates
Affiliates FAQ
Affiliate Sign Up Form
Register Client
Affiliate Login

Free Tech Guides

Web Design Project Guide
Copywriting Guide

Company

About Us
Rate Card
Blog
Testimonials
Newsletter Archive
Schedule Call
Google Business Site
Jobs at JUCRA
Contact Us

Please Review Us

web design marbella
Google Reviews
Facebook Reviews

Copyright JUCRA Digital SL

JUCRA Digital is registered in V.I.E.S under registration number: ESB93637767 

JUCRA Digital’s Legal Entity Identifier (L.E.I) is: 984500750F7CF6665719 View Certificate

Scroll Up