When a script or external service needs API access to a site, sharing the account’s main password is inconvenient. WordPress application passwords offer another approach: create a separate secret for a specific integration and revoke it without changing the user’s main password.
Below I explain how to create one in a WordPress profile, use it in a REST API request and troubleshoot access. The guide is based on the official WordPress documentation.
How WordPress application passwords work
An application password is tied to a specific WordPress user and intended for programmatic access, including the REST API. A maintenance script, publishing service or client using the site API might need one.
The two scenarios are distinct. The main password is used for normal account login. An application password authenticates a program to the API; it cannot be used to sign in to the admin area through wp-login.php.
I recommend creating a separate password for each integration. The name in the profile then shows who received access, and revoking one password does not require changing the user’s main password. Avoid reusing the same secret in other tools.
Create a password in the user profile
First decide which user account the integration will act as. An application password is attached to that account; it does not exist independently of it.
- Sign in to wp-admin as the appropriate user and open Users → Profile. If you are an administrator configuring another user’s access, open their profile through Users → All Users.
- Find the Application Passwords section; its interface label may depend on the admin language.
- Enter a recognisable name, such as “Reporting integration” or “Maintenance script”, so you can identify the password’s purpose later.
- Generate the password, copy it immediately and store it securely as a secret.
- Provide the password only to the application for which it was created.
WordPress displays the generated password only when it is created and stores it as a hash. Copy it at that point rather than waiting until integration setup. If it is lost, revoke the old one and create a new one.
The displayed password is grouped for readability. According to WordPress documentation, it can be used with or without spaces: spaces are removed before verification.
Send a REST API request
HTTP Basic Authentication needs two parts: the WordPress username and the newly created application password. The client passes the credentials in the Authorization header. Use HTTPS: without encryption, credentials can be intercepted on the network.
The official documentation gives this curl example:
`curl --user "USERNAME:APPLICATION_PASSWORD" https://example.com/wp-json/wp/v2/users/me`
Replace `USERNAME` with the appropriate user login, `APPLICATION_PASSWORD` with the generated password and `example.com` with your site address. The example endpoint requests the current user’s data.
Treat this as a demonstration of the format, not a command to publish with a real secret. Do not put the actual password in project documentation, messages or screenshots. A command containing a secret may also remain in shell history; for a working integration, store and pass the secret separately from the code.
Review usage and revoke access
In the same profile section, you can see existing passwords by name and usage metadata, including the time and IP address of last use. Periodically compare the list with the integrations the project actually needs.
When a service is no longer needed or a leak is suspected, open the user profile, find the relevant name and revoke that password. If the integration still needs access, create a new secret and update its configuration.
- Name passwords so the site owner can recognise the integration without extra explanation.
- Do not use one password across several tools: that makes it harder to choose which access to revoke.
- Revoke secrets that are no longer needed and rotate them on a schedule or after a suspected leak.
A name helps with inventory, but it does not configure permissions. Before issuing a secret, check that this user is the right account for the integration.
What to check if access does not work
If a request returns 401 or 403, or the application passwords section is absent from the profile, start with the basic checks recommended by WordPress:
- Make sure the site uses HTTPS and WordPress recognises the connection as HTTPS.
- Check that you are sending the correct user login and an application password, not the main login password.
- Find out whether application passwords have been disabled in site settings or code, including by a security plugin.
These checks are a starting point, not a universal explanation for every error. If an external service configures the integration, check the username, site URL and secret it uses as well.
Conclusion
For REST API access I would start with a simple setup: one user, a recognisable integration name and a separate application password sent only over a secure connection. Then maintain it: store secrets securely, review the list and revoke unnecessary access. This allows integrations to be managed separately without distributing the account’s main password.
Source
- WordPress Documentation: Application Passwords — creating, using, revoking and troubleshooting application passwords.


