Title: Programmatically add roles and link users
Last modified: March 8, 2019

---

# Programmatically add roles and link users

 *  Resolved [willevanstyxan](https://wordpress.org/support/users/willevanstyxan/)
 * (@willevanstyxan)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/programmatically-add-roles-and-link-users/)
 * Hi there,
    we want to create new roles via a php script and then automatically
   add certain users to these new roles. Can you point us in the right direction
   as to if this has been done before or how you think we could go about it?
 * Thanks

The topic ‘Programmatically add roles and link users’ is closed to new replies.

 * ![](https://ps.w.org/members/assets/icon-256x256.png?rev=3508404)
 * [Members - Membership & User Role Editor Plugin](https://wordpress.org/plugins/members/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/members/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/members/)
 * [Active Topics](https://wordpress.org/support/plugin/members/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/members/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/members/reviews/)

## Tags

 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 0 replies
 * 1 participant
 * Last reply from: [willevanstyxan](https://wordpress.org/support/users/willevanstyxan/)
 * Last activity: [7 years, 2 months ago](https://wordpress.org/support/topic/programmatically-add-roles-and-link-users/)
 * Status: resolved