Users
Create, update, delete, and list the Users of the website.
Table Specific Information
Select
The server uses the WordPress API to process supported filters. The server processes other filters client-side within the server. To retrieve and filter the values for the Roles column, use Context='edit' in the WHERE clause.
For example, the following queries are processed server side.
Only users that have published posts will be returned.
SELECT * FROM Users WHERE Id IN ('1', '23')
SELECT * FROM Users WHERE Roles IN ('editor, administrator') AND Context='edit'
SELECT * FROM Users ORDER BY Email
Also, ordering by Id, Name, RegisteredDate, and Url is handled by the WordPress API.
Insert and Update
To insert a user you must specify the following columns: Username, Email, and Password.
INSERT INTO Users (Username, Email, Password) VALUES ('DemoUser', '[email protected]', 'aPassword')
Update
To update a user you must specify the following column: Id.
UPDATE Users SET Name = 'First Last' WHERE Id = '12345'
Other fields that you can use on INSERT and UPDATE queries are the following: Username, Name, FirstName, LastName, Email, Url, Description, Locale, Nickname, Roles.
Delete
To delete a user you must specify the following column: Id.
DELETE FROM Users WHERE Id = '12345'
Columns
| Name | Type | ReadOnly | References | Description |
| Id [KEY] | Integer | True |
The unique identifier of the user account in WordPress. | |
| Username | String | False |
The username used by the user to log in to WordPress. | |
| Name | String | False |
The display name of the user, shown publicly on posts and comments. | |
| FirstName | String | False |
The first name of the user as stored in their WordPress profile. | |
| LastName | String | False |
The last name of the user as stored in their WordPress profile. | |
| String | False |
The email address associated with the user's account, used for notifications and password resets. | ||
| Roles | String | False |
The roles assigned to the user, defining their permissions and capabilities. Use with the IN operator and context=edit to filter by role. | |
| Description | String | False |
A short biography or description provided in the user's profile. | |
| Locale | String | False |
Specifies the user's language and regional setting, based on WordPress locale codes. | |
| Nickname | String | False |
An alternate name the user chooses to display instead of their username. | |
| RegisteredDate | Datetime | True |
The date and time when the user registered on the WordPress site. | |
| Link | String | True |
The author archive URL associated with the user, listing their published posts. | |
| Url | String | False |
The website URL provided in the user's profile. | |
| Administrator | Boolean | True |
Indicates whether the user has the Administrator role with full site access. | |
| EditPosts | Boolean | True |
Indicates whether the user has permission to edit their own posts. | |
| PublishPosts | Boolean | True |
Indicates whether the user can publish new posts. | |
| DeletePosts | Boolean | True |
Indicates whether the user can delete their own posts. | |
| EditPages | Boolean | True |
Indicates whether the user can edit pages on the WordPress site. | |
| PublishPages | Boolean | True |
Indicates whether the user can publish new pages. | |
| DeletePages | Boolean | True |
Indicates whether the user can delete pages from the site. | |
| EditUsers | Boolean | True |
Indicates whether the user can edit other user accounts. | |
| CreateUsers | Boolean | True |
Indicates whether the user can create new user accounts. | |
| PromoteUsers | Boolean | True |
Indicates whether the user can promote users to higher roles. | |
| DeleteUsers | Boolean | True |
Indicates whether the user can delete other user accounts. | |
| EditThemes | Boolean | True |
Indicates whether the user can modify theme files or settings. | |
| UpdateThemes | Boolean | True |
Indicates whether the user can update installed themes. | |
| InstallThemes | Boolean | True |
Indicates whether the user can install new themes. | |
| DeleteThemes | Boolean | True |
Indicates whether the user can delete installed themes. | |
| SwitchThemes | Boolean | True |
Indicates whether the user can switch the active theme for the site. | |
| ActivatePlugins | Boolean | True |
Indicates whether the user can activate installed plugins. | |
| UpdatePlugins | Boolean | True |
Indicates whether the user can update existing plugins. | |
| EditPlugins | Boolean | True |
Indicates whether the user can edit plugin code or settings. | |
| DeletePlugins | Boolean | True |
Indicates whether the user can delete installed plugins. | |
| EditFiles | Boolean | True |
Indicates whether the user can edit files directly through the WordPress interface. | |
| UploadFiles | Boolean | True |
Indicates whether the user can upload media or other files to the site. | |
| ManageOptions | Boolean | True |
Indicates whether the user can manage general site options and settings. | |
| ManageCategories | Boolean | True |
Indicates whether the user can manage and organize post categories. | |
| EditDashboard | Boolean | True |
Indicates whether the user can customize or edit the WordPress dashboard. |
Pseudo-Columns
Pseudo-column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the data returned by the operation.
| Name | Type | Description |
| Password | String |
The user's password value, used only during account creation; not returned in responses. |
| Context | String |
Defines the request scope, which determines which fields are included in the response, such as view or edit. The allowed values are view, edit, embed. |