Skip to content

Update User Profile

The Update User Profile node updates the current WordPress user's core profile fields and custom meta data. It only allows users to update their own profile -- not other users'.

Configuration

This node has no configuration options. It reads the fields to update from the input data.

Input

Accepts a single object (associative array). The keys determine which fields are updated.

Core Fields

These fields are updated via wp_update_user():

KeyDescription
display_nameThe user's display name.
user_emailThe user's email address.
first_nameFirst name.
last_nameLast name.
descriptionBiographical info.
user_urlWebsite URL.

Meta Fields

Any other key (that does not start with _ and is not ID or id) is saved as user meta via update_user_meta().

Output

Returns the input data with _updated: true and _user_id added on success.

json
{
  "display_name": "Jane Doe",
  "phone": "+1-555-0123",
  "_updated": true,
  "_user_id": 5
}

On error (not logged in):

json
{
  "_valid": false,
  "_errors": [{ "field": "_auth", "message": "You must be logged in." }]
}

Security

  • All values are sanitized with sanitize_key() for keys and sanitize_text_field() for values.
  • The node uses get_current_user_id() and only updates that user's data.
  • Keys starting with _, ID, and id are ignored to prevent privilege escalation.

Example Use Cases

Profile update form

Context --> Validate --> Sanitize --> Update User Profile --> Output

Form fields: display_name, user_email, phone (meta), company (meta).

Update user preferences

Context --> Set Field (theme = 'dark') --> Update User Profile --> Output

Onboarding flow

Context --> Validate --> Update User Profile --> Set Field (onboarding_complete = '1') --> Update User Profile --> Output

WARNING

This node only updates the current user's profile. There is no way to update another user's data through this node, which is a deliberate security constraint.