Title: Update Avatars Programatically
Last modified: October 5, 2020

---

# Update Avatars Programatically

 *  Resolved [cspit](https://wordpress.org/support/users/cspit/)
 * (@cspit)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/update-avatars-programatically/)
 * Our users are created using the next-ad plugin. Though this plugin is supposed
   to import profile pictures from AD it has issues from time to time. We started
   using wp-user-avatar a while back to manually upload images.
 * I am attempting to automate updating our profile pictures across all services
   our business uses. The last one on my list is our internal wordpress sites. I
   can upload images to wordpress but am unable to find anyplace in the database
   to change which profile picture the user should use.
 * Open to either direct database manipulation or creating a webhook.

Viewing 1 replies (of 1 total)

 *  Thread Starter [cspit](https://wordpress.org/support/users/cspit/)
 * (@cspit)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/update-avatars-programatically/#post-13568763)
 * I was able to get further with this by bringing up the form on a dedicated page(
   ignore some of the extra lines with the ID.).
 *     ```
       <?php
       $dir='/var/www/html/wordpress';
       $full="$dir/wp-load.php";
       require_once $full;
       $u=get_user_by('email', 'user@domain');
       $uid=$u->ID;
       echo get_wp_user_avatar($uid);
       echo do_shortcode('[avatar_upload user="user"]');
       ?>
       ```
   
 * However, when I try to use any of the buttons nothing happens. My hope is to 
   use a custom form that python sessions can interact with.

Viewing 1 replies (of 1 total)

The topic ‘Update Avatars Programatically’ is closed to new replies.

 * ![](https://ps.w.org/wp-user-avatar/assets/icon-256x256.png?rev=2532486)
 * [Paid Membership Plugin, Ecommerce, User Registration Form, Login Form, User Profile & Restrict Content – ProfilePress](https://wordpress.org/plugins/wp-user-avatar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-user-avatar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-user-avatar/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-user-avatar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-user-avatar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-user-avatar/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [cspit](https://wordpress.org/support/users/cspit/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/update-avatars-programatically/#post-13568763)
 * Status: resolved