Title: Custom User Profile Photo
Author: Vincent Listrani
Published: <strong>November 1, 2013</strong>
Last modified: May 24, 2017

---

Search plugins

![](https://ps.w.org/custom-user-profile-photo/assets/banner-772x250.jpg?rev=800520)

This plugin **hasn’t been tested with the latest 3 major releases of WordPress**.
It may no longer be maintained or supported and may have compatibility issues when
used with more recent versions of WordPress.

![](https://s.w.org/plugins/geopattern-icon/custom-user-profile-photo_e4e4e4.svg)

# Custom User Profile Photo

 By [Vincent Listrani](https://profiles.wordpress.org/vincentlistrani/)

[Download](https://downloads.wordpress.org/plugin/custom-user-profile-photo.0.5.3.zip)

 * [Details](https://wordpress.org/plugins/custom-user-profile-photo/#description)
 * [Reviews](https://wordpress.org/plugins/custom-user-profile-photo/#reviews)
 *  [Installation](https://wordpress.org/plugins/custom-user-profile-photo/#installation)
 * [Development](https://wordpress.org/plugins/custom-user-profile-photo/#developers)

 [Support](https://wordpress.org/support/plugin/custom-user-profile-photo/)

## Description

A more flexible way to attach and display a photo for a WordPress user profile.

Some users might not have or want to have a gravatar account or other universal 
avatar account. They simply may want to use a one-time specified photo to represent
them on your WordPress site. This plugin solves that use case.

With the ability to upload a photo to a user profile via the WordPress Media Uploader
or by specifying an external URL to an image, your users and/or authors can have
a personalized photo specific to your website.*

This plugin will add a custom set of fields to the user profile page which will 
allow for the use of a custom profile photo.

You can add/change/edit uploaded photos directly from the user profile page. The
external option allows you to provide a URL to the external image or remove it.

**As of v0.4**, the plugin now filters the get_avatar() function found in most WordPress
themes.

Simply go to the users section and select a user or select “Your Profile” depending
on your permission level. The new fields are added to the bottom of the user profile
page. Choose which type of photo you want to use. Upload an image or add an external
url. Then press the Update Profile button.

If you require a customized approach or your theme does not support the get_avatar()
hook, use the example below.

To retrieve the photo on the front-end use the following example on your template
page(s).

    ```
    <?php
        // Retrieve The Post's Author ID
        $user_id = get_the_author_meta('ID');
        // Set the image size. Accepts all registered images sizes and array(int, int)
        $size = 'thumbnail';

        // Get the image URL using the author ID and image size params
        $imgURL = get_cupp_meta($user_id, $size);

        // Print the image on the page
        echo '<img src="'. $imgURL .'" alt="">';
    ?>
    ```

You will need to place the code above in each area of your theme where you wish 
to add and retrieve your theme’s custom avatar image. This can include but is not
limited to single.php, page.php, and comments.php.

*Future Updates to this plugin include allowing other roles to access this feature,
a settings page to allow a custom default image and other options.

### Translations

 * English – default, always included
 * Dutch
 * Hungarian
 * Spanish

### Credits

Thanks to [Olaf Lederer](https://profiles.wordpress.org/finalwebsites/), [Harkály Gergő](https://github.com/harkalygergo),
[sqhendr](https://profiles.wordpress.org/sqhendr/), [SOMTIJDS](https://profiles.wordpress.org/somtijds/),
[David Pérez](https://www.closemarketing.es)

## Screenshots

[⌊The new fields that are added to the user profile page.⌉⌊The new fields that are
added to the user profile page.⌉[

The new fields that are added to the user profile page.

[⌊After uploading and saving your selected image.⌉⌊After uploading and saving your
selected image.⌉[

After uploading and saving your selected image.

[⌊On hover, Edit or Remove an uploaded image.⌉⌊On hover, Edit or Remove an uploaded
image.⌉[

On hover, Edit or Remove an uploaded image.

[⌊On hover, Remove a URL to an external image.⌉⌊On hover, Remove a URL to an external
image.⌉[

On hover, Remove a URL to an external image.

[⌊An example of getting this new image to display on the front-end.⌉⌊An example 
of getting this new image to display on the front-end.⌉[

An example of getting this new image to display on the front-end.

## Installation

 1. Upload `custom-user-profile-photo` folder to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress
 3. Place `<?php get_cupp_meta($user_id, $size); ?>` in your templates

## FAQ

### Who can upload and manage these images?

Currently, only a user with the upload_files capability can use this option.
 Editors
and Admins can upload and edit files. Authors can only upload files. Subscribers
and Contributors cannot do either so an Admin will need to do this for them.

### I installed the plugin but I want to customize the output and placement of the image. Is this possible?

Yes, you can still customize the output by using the get_cupp_meta() function. Please
reference the code snippet below or on the Description tab.

Where the $user_ID is the users ID number and the size is a registered image size
like ‘thumbnail’ or an array like `array(50,50)`.

## Reviews

![](https://secure.gravatar.com/avatar/a81ef2b7a6529a58f0840a488570433f5467021fa50c20503ec6e6d703d235bb?
s=60&d=retro&r=g)

### 󠀁[Alternative of gravatar to change profile photo](https://wordpress.org/support/topic/alternative-of-gravatar-to-change-profile-photo/)󠁿

 [themeshef](https://profiles.wordpress.org/themeshef/) April 7, 2018

This author did a good job. I was looking for an alternative of gravatar to change
administrator profile pictures & fortunately found this plugin. It’s free! Awesome!

![](https://secure.gravatar.com/avatar/c4195fbebb81c0f3ec9342f17456bffaab770afc095d13a3998699e04307e65e?
s=60&d=retro&r=g)

### 󠀁[Should Be in the WP Core](https://wordpress.org/support/topic/should-be-in-the-wp-core-2/)󠁿

 [wadsworth4](https://profiles.wordpress.org/wadsworth4/) January 22, 2018

CMS users should always be able to upload their own image, not be chained to an 
avatar service or some avatar set. This little plugin lets all our members effortlessly
add their own photo. Super handy plugin!

![](https://secure.gravatar.com/avatar/8c38d1f74123627f87786df050eff4cf1429cfd4b3f0624fd4d020c9c57be55e?
s=60&d=retro&r=g)

### 󠀁[Simply working](https://wordpress.org/support/topic/simply-working-6/)󠁿

 [SineMetu](https://profiles.wordpress.org/sinemetu/) November 28, 2017

that plugin is just simply working, and doing exactly what is says. thanks guys.

![](https://secure.gravatar.com/avatar/8462aa8032c76b773e27faf2d0ee5f871638f12b538fddda33de71836d4e669d?
s=60&d=retro&r=g)

### 󠀁[Misunderstanding](https://wordpress.org/support/topic/suspect-it-has-malicious-code/)󠁿

 [almend](https://profiles.wordpress.org/almend/) May 3, 2017 3 replies

.

![](https://secure.gravatar.com/avatar/eccfabc379468086fecb11131a29ad97ffb6ecf83c6c764371f88d3dc45e3711?
s=60&d=retro&r=g)

### 󠀁[Very good](https://wordpress.org/support/topic/very-good-2158/)󠁿

 [athensrealestate](https://profiles.wordpress.org/athensrealestate/) April 5, 2017

I use the free version. It’s very good plugin and easy to adapt. Thanks!

![](https://secure.gravatar.com/avatar/57c3515ebd17b260aa6bb462e2544f72a7925105b023863463d0ef62b8d353b9?
s=60&d=retro&r=g)

### 󠀁[Awesome Plugin](https://wordpress.org/support/topic/awesome-plugin-2404/)󠁿

 [Zain Neil B Ul Abadin](https://profiles.wordpress.org/kakashi-hatake/) January
24, 2017

Thanks dude you really saved my day 😉

 [ Read all 27 reviews ](https://wordpress.org/support/plugin/custom-user-profile-photo/reviews/)

## Contributors & Developers

“Custom User Profile Photo” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ Vincent Listrani ](https://profiles.wordpress.org/vincentlistrani/)
 *   [ Jeremy Ward ](https://profiles.wordpress.org/jmichaelward/)

“Custom User Profile Photo” has been translated into 1 locale. Thank you to [the translators](https://translate.wordpress.org/projects/wp-plugins/custom-user-profile-photo/contributors)
for their contributions.

[Translate “Custom User Profile Photo” into your language.](https://translate.wordpress.org/projects/wp-plugins/custom-user-profile-photo)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/custom-user-profile-photo/),
check out the [SVN repository](https://plugins.svn.wordpress.org/custom-user-profile-photo/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/custom-user-profile-photo/)
by [RSS](https://plugins.trac.wordpress.org/log/custom-user-profile-photo/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 0.5.3

 * Addressed an issue where an object being passed into `cupp_get_user_by_id_or_email`
   could potentially be the WP_Comment object.

#### 0.5.2

 * Fixed issue with a PHP warning when getting the user with the WP_User object.

#### 0.5.1

 * Fixed issue with `update_user_attribute`.

#### 0.5

 * Major Update – please be sure to backup your site and db.
 * Replaced `update_user_meta` with `update_user_attribute` per WordPress VIP Standards.
 * Replaced `get_home_url` with `get_site_url` for users where the edit image link
   was returning a 404. Credit: SOMTIJDS
 * Fixed textdomain loading issue.
 * Added Spanish translation. Credit: David Pérez
 * Updated and formatted code per PHPCS. Credit: jmichaelward
 * Refactored multiple functions and variables for simplicity and compatibility.
   Credit: jmichaelward

#### 0.4

 * Major Update – please be sure to backup your site and db.
 * The plugin now overrides the WordPress avatar by filtering the get_avatar() hook.
 * The get_cupp_meta() function still exists and can be used to customize the output(
   this will eventually be deprecated).

#### 0.3

 * Changed the function which gets the attachment post ID by GUID to the WordPress
   core function attachment_url_to_postid() for better reliability. (Props to sqhendr).

#### 0.2.7

 * Added Hungarian Translation (Thanks to Harkály Gergő)

#### 0.2.6

 * Fixed a bug where the save function required a different capability than the 
   upload function (courtesy of douglas_johnson).

#### 0.2.5

 * Tested with WordPress v4.1
 * Fixed a bug where the external URL option would not return the URL with get_cupp_meta().
 * Fixed a bug where the saved image did not correspond to the selected radio button.
 * Replaced depricated update_usermeta with update_user_meta.
 * Improved image selection functionality.
 * Images now show immediately after selecting an uploaded item or entering an external
   URL.
 * Added Dutch translation – Thanks Olaf Lederer

#### 0.2.4

 * Tested with WordPress v3.8
 * Updated description text. Better explanation of how to quickly use this plugin.

#### 0.2.3

 * Beta version release.

## Meta

 *  Version **0.5.3**
 *  Last updated **9 years ago**
 *  Active installations **4,000+**
 *  WordPress version ** 3.6.1 or higher **
 *  Tested up to **4.7.33**
 *  Languages
 * [English (US)](https://wordpress.org/plugins/custom-user-profile-photo/) and 
   [Persian](https://fa.wordpress.org/plugins/custom-user-profile-photo/).
 *  [Translate into your language](https://translate.wordpress.org/projects/wp-plugins/custom-user-profile-photo)
 * Tags
 * [custom profile photo](https://wordpress.org/plugins/tags/custom-profile-photo/)
   [custom profile picture](https://wordpress.org/plugins/tags/custom-profile-picture/)
   [profile photo](https://wordpress.org/plugins/tags/profile-photo/)[profile picture](https://wordpress.org/plugins/tags/profile-picture/)
   [user profile](https://wordpress.org/plugins/tags/user-profile/)
 *  [Advanced View](https://wordpress.org/plugins/custom-user-profile-photo/advanced/)

## Ratings

 4.4 out of 5 stars.

 *  [  19 5-star reviews     ](https://wordpress.org/support/plugin/custom-user-profile-photo/reviews/?filter=5)
 *  [  2 4-star reviews     ](https://wordpress.org/support/plugin/custom-user-profile-photo/reviews/?filter=4)
 *  [  3 3-star reviews     ](https://wordpress.org/support/plugin/custom-user-profile-photo/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/custom-user-profile-photo/reviews/?filter=2)
 *  [  2 1-star reviews     ](https://wordpress.org/support/plugin/custom-user-profile-photo/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/custom-user-profile-photo/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/custom-user-profile-photo/reviews/)

## Contributors

 *   [ Vincent Listrani ](https://profiles.wordpress.org/vincentlistrani/)
 *   [ Jeremy Ward ](https://profiles.wordpress.org/jmichaelward/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/custom-user-profile-photo/)