{"id":19041815,"date":"2026-10-10T21:02:10","date_gmt":"2026-10-10T21:02:10","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/programmatically-create-roles\/"},"modified":"2026-10-10T21:02:10","modified_gmt":"2026-10-10T21:02:10","slug":"programmatically-create-roles","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/programmatically-create-roles\/","title":{"rendered":"Programmatically create roles"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I wonder if it is possible to create roles programmatically (= by PHP, I have full access to the database).<br><br>Use case: I want to assign a unique role to each user. I need this to be able to serve very specific content to individual users (as well as groups of users).<br><br>For example: all managers may view an employees performance review, as well as the employee in question.<br><br>If this is possible, is there a maximum number of possible roles. I need a few thousand&#8230;<br><br>Cheers,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Martijn<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"template":"","class_list":["post-19041815","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19041815","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19041815\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=19041815"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}