Store wordpress user role as user app_metadata

Hey all,

How would I go about storing a users wordpress role e.g. ‘Subscriber’ or ‘Customer’ in each Auth0 users app_metadata so that I can restrict content on my SPA to certain user roles.

Thanks in advance!

Hi @hillierliam37,

Welcome to the Auth0 Community Forum!

Have you checked out the management api? You should be able to do that!!/Users/patch_users_by_id

Let me know if you run into any issues.


Hey @dan.woda,

Thanks for the above, i’ve managed to set it up. Just one issue.

Im using, which gives me the wordpress user ID, but I need the auth0 user ID so that I can make a patch request to update the user.

Do you know how I can get the Auth0 ID of the user instead of the wordpress id whenever the user logs in?

Solved! Auth0 ID was saved in the $userinfo. Everything working perfectly!


Glad to hear you got it working!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.