• How to remove the profile picture section from WordPress admin panel and the link “You can change your profile picture on Gravatar.”

Viewing 7 replies - 1 through 7 (of 7 total)
  • In Admin dashboard go to Settings > Discussion Settings > Avatars > Show Avatars and uncheck the box.

    Thread Starter pattaya_web

    (@pattaya_web)

    Thanks, but that turns avatars off everywhere. I just want to get rid of it from the user profile page because we use another plugin to generate user profile photos

    [ No bumping please. ]

    You Can change your profile pic avatar from http://gravatar.com/ .
    Login Gravatar.com using wordpress email id that you are using in your wordpress and change your profile pic from there

    You must create a Child Theme for this.

    After creating the Child Theme, paste this code in the functions.php file with NO space underneath the last line of code and NO closing tag?>“.

    if( ! function_exists('show_avatars') ) {
    	add_filter('pre_option_show_avatars', 'override_show_avatars');
    	function override_show_avatars() {
    		global $current_user; 
    
    		if (current_user_can('administrator')) {
    		return false;
    		}
    		return $current_user->show_avatars;
    	}
    }

    This will disable the Avatars function in all users except the administrators of your site.

    In the Child Theme style.css, paste this code.

    #comments .comment-author.vcard img {
    	display: none;
    }

    This will hide the avatars in the comments for everyone including admins and the public.
    I have tested this in my development site and it works.
    Any issues, let me know.

    I question this answer, I mean no offense to @neotechnomad, I am sure he/she is a competent developer.

    Why is a Child Theme required? No one in the thread specified the use of any particular theme, unless I am reading incorrectly. Besides isn’t this the Wp admin section being modified? Aren’t plugins suggested for WordPress Admin development?

    Why is a Child Theme required? No one in the thread specified the use of any particular theme, unless I am reading incorrectly. Besides isn’t this the Wp admin section being modified? Aren’t plugins suggested for WordPress Admin development?

    A Child Theme is required because there are alterations to the functions.php and the style.css, not merely the functions.
    This pair of codes affect the admin area and the comments section on single posts and pages.
    And, if there are problems, then a child theme is easily deactivated through the cPanel or FTP.

    Thanks for the clarification on your answer.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Remove user photo option from user profile page’ is closed to new replies.