Title: Approve users through code?
Last modified: February 8, 2021

---

# Approve users through code?

 *  Resolved [mozboz](https://wordpress.org/support/users/mozboz/)
 * (@mozboz)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/approve-users-through-code/)
 * Hi, we’re using your plugin and it’s working great.
 * We have an application now where we want to be able to approve users through 
   code in another plugin in some cases, can you recommend the best way to do this?
   I’ve had a look at the code but it seems like all the methods that do approval
   are expecting to be called from the admin UI and do a bunch of checks that would
   fail if called from another plugin (esp. outside of the admin UI)
 * Any help appreciated 🙂
 * m

Viewing 1 replies (of 1 total)

 *  Plugin Author [Konstantin Obenland](https://wordpress.org/support/users/obenland/)
 * (@obenland)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/approve-users-through-code/#post-14667043)
 * Sure, running `update_user_meta( $user_id, 'wp-approve-user', true );` with the
   user id as the first argument will mark that user as approved.

Viewing 1 replies (of 1 total)

The topic ‘Approve users through code?’ is closed to new replies.

 * ![](https://ps.w.org/wp-approve-user/assets/icon-256x256.png?rev=3013178)
 * [WP Approve User](https://wordpress.org/plugins/wp-approve-user/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-approve-user/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-approve-user/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-approve-user/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-approve-user/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-approve-user/reviews/)

## Tags

 * [api](https://wordpress.org/support/topic-tag/api/)

 * 1 reply
 * 2 participants
 * Last reply from: [Konstantin Obenland](https://wordpress.org/support/users/obenland/)
 * Last activity: [4 years, 10 months ago](https://wordpress.org/support/topic/approve-users-through-code/#post-14667043)
 * Status: resolved