# Roles Synchronization

You can set up synchronization of WordPress user roles with Discord member roles. First, you need to assign bindings of role pairs. Go to the WordPress admin panel and _**Settings**_ --> _**Discord**_ and open the _**Synchronization**_ tab. You will find the interface of role bonding.

The left select is the WordPress role, and the right is the Discord role. If you do not see all Discord roles in the select, try to update roles data in the _**Data Update**_ section. Also, if the role is already bonded, it will not appear in the selection.

The arrow shows the direction of synchronization. If the arrow points from WordPress to Discord, then during syncing, Discord roles will be changed accordingly to WordPress. If it points from Discord to WordPress, then WordPress roles will be adjusted accordingly to Discord. For example, if you sync two roles from WP to Discord and the user has only one WP role, then the existing role will be assigned, and absent will be removed from Discord.  To switch the direction of the syncing, click the _**Reverse**_ button beneath the arrow.

{% hint style="info" %}
During synchronization, not bonded roles from both sides will be ignored.
{% endhint %}

{% hint style="warning" %}
WordPress keeps multiple assigned roles but displays only the highest one.
{% endhint %}

{% hint style="danger" %}
Be very careful with bonding pairs. As an administrator, you can assign any combinations. For example, you can bind the administrator WordPress role with some typical role in the guild, and all WP users will get or lose the administrator role depending on the sync direction. These actions are not reversible, and you will have to restore website backup to undo it!
{% endhint %}

If you synchronize roles from WP to Discord, make sure that the roles you are trying to assign are positioned beneath the Bot role. Go to the <mark style="background-color:red;">Discord client</mark> and open the guild settings. On the Roles page, you can find a list of existing roles. Rearrange them - put the bot role on top of all assignable roles.

![](https://content.gitbook.com/content/b9pNburQqbG9yq2Ev6Tf/blobs/2IpQhTpw2WmKUsts2F9p/e1.png)

{% hint style="info" %}
Roles synchronization will work only on a WordPress profile with a connected Discord profile.
{% endhint %}

You can start synchronizing all users immediately by updating the _**Synchronization of all roles of all users**_ in the _**Update Intervals**_ table below. By default, the roles of all users are scheduled for synchronization every four days. Also, the particular user will be synchronized on registration or authorization via Discord profile and role change on the website.

{% hint style="warning" %}
When syncing is executed during the manual change in the user profile or by change from other plugins, syncing will be only in one direction - from WP to Discord. Skipping syncing from Discord to WP is essential at such moments because it may create unexpected events in other plugins. If you have a setup to change the WP role back, it will happen during the next full syncing. This also can create loops.
{% endhint %}

_**Assign role when profile connected with the connect profile button**_ option will allow you to choose a role that will be automatically assigned when the user connects a Discord profile with the connect profile button.

{% hint style="warning" %}
This function will not work if you manually disconnect the Discord profile in the admin panel.
{% endhint %}
