Users
Create, update, delete, and list the Users of the website.
Table Specific Information
Select
The cmdlet uses the WordPress API to process supported filters. The cmdlet processes other filters client-side within the cmdlet. You can turn off the client-side execution of the query by setting SupportEnhancedSQL to false in which case any search criteria that refers to other columns will cause inconsistent data. To retrieve and filter the values for 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 EmailAlso, 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 | Description |
Id [KEY] | Integer | True |
Unique identifier for the user. |
Username | String | False |
Login name for the user. |
Name | String | False |
Display name for the user. |
FirstName | String | False |
First name for the user. |
LastName | String | False |
Last name for the user. |
String | False |
The email address for the user. | |
Roles | String | False |
Roles assigned to the user. Use this with IN operator. To retrieve and filter the values for this column, use context=edit in the WHERE clause. |
Description | String | False |
Description of the user. |
Locale | String | False |
Locale for the user. |
Nickname | String | False |
The nickname for the user. |
RegisteredDate | Datetime | True |
Registration date for the user. |
Link | String | True |
Author URL of the user. |
Url | String | False |
URL of the user. |
Administrator | Boolean | True |
Whether or not the user is Administrator. |
EditPosts | Boolean | True |
Whether or not the user can edit posts. |
PublishPosts | Boolean | True |
Whether or not the user can publish posts. |
DeletePosts | Boolean | True |
Whether or not the user can delete posts. |
EditPages | Boolean | True |
Whether or not the user can edit pages. |
PublishPages | Boolean | True |
Whether or not the user can publish pages. |
DeletePages | Boolean | True |
Whether or not the user can delete pages. |
EditUsers | Boolean | True |
Whether or not the user can edit users. |
CreateUsers | Boolean | True |
Whether or not the user can create users. |
PromoteUsers | Boolean | True |
Whether or not the user can promote users. |
DeleteUsers | Boolean | True |
Whether or not the user can delete users. |
EditThemes | Boolean | True |
Whether or not the user can edit themes. |
UpdateThemes | Boolean | True |
Whether or not the user can update themes. |
InstallThemes | Boolean | True |
Whether or not the user can install themes. |
DeleteThemes | Boolean | True |
Whether or not the user can delete themes. |
SwitchThemes | Boolean | True |
Whether or not the user can switch themes. |
ActivatePlugins | Boolean | True |
Whether or not the user can activate plugins. |
UpdatePlugins | Boolean | True |
Whether or not the user can update plugins. |
EditPlugins | Boolean | True |
Whether or not the user can edit plugins. |
DeletePlugins | Boolean | True |
Whether or not the user can delete plugins. |
EditFiles | Boolean | True |
Whether or not the user can edit files. |
UploadFiles | Boolean | True |
Whether or not the user can upload files. |
ManageOptions | Boolean | True |
Whether or not the user can manage options. |
ManageCategories | Boolean | True |
Whether or not the user can manage categories. |
EditDashboard | Boolean | True |
Whether or not the user can edit dashboard. |
Pseudo-Columns
Name | Type | Description |
Password | String |
Password for the user (never included). |
Context | String |
Scope under which the request is made; determines fields present in response. The allowed values are view, edit, embed. |