Sébastien Laframboise

Using WordPress application passwords securely

Using WordPress application passwords securely

WordPress application passwords allow an external service, script, or mobile app to access your site without being given a user’s primary password. You can therefore authorize a specific integration and later revoke that access without signing the user out or changing their other credentials.

This native WordPress feature is suitable for programmatic access. However, it does not replace roles, permissions, or two-factor authentication. To use it safely, create a separate credential for each integration, protect the generated secret, and revoke it as soon as it’s no longer needed.

What are WordPress application passwords used for?

An application password is tied to an existing WordPress user. It’s mainly used to authenticate requests to the REST API, and also to XML-RPC when that interface is enabled. WordPress introduced this feature in version 5.6 in December 2020.

The official documentation on application passwords notes that they can be revoked individually, are stored hashed, and are shown only once at creation. They do not allow logging in at the WordPress login screen or accessing the admin area in a browser.

Appropriate use cases

Use this mechanism when a tool must act on behalf of a user on your site without knowing their normal password. For example, an app might publish a post, upload media, or access a resource authorized via the API.

  • A maintenance script that calls an authorized REST route.
  • An external tool that creates or updates content.
  • A mobile or desktop application that accesses your site.
  • An internal integration that needs to upload files or read data.

By contrast, a plugin or JavaScript that runs in the admin normally uses the already open session and a REST nonce. The API REST authentication documentation distinguishes this logged-in context from remote access via application passwords.

Understand the most important limitation: the account’s rights

An application password does not create a standalone permission level. The integration receives the same capabilities as the user it’s attached to. If you create it for an administrator, the tool can perform API actions permitted to that administrator.

Therefore, avoid automatically linking every integration to your primary admin account. Instead, create a dedicated account for the integration when its work justifies it. Assign only the role necessary. Also see roles and permissions in WordPress to choose an access level consistent with the required task.

An author account may be sufficient for an integration that publishes its own posts. An administrator account would be unnecessarily powerful in that scenario. This separation limits the impact if the secret is leaked.

Create an application password without exposing your account

Before you begin, verify that your site uses HTTPS. WordPress makes application passwords available by default for requests served over HTTPS. This precaution is essential because HTTP Basic authentication sends credentials with every request in the Authorization header.

  1. Log in to the admin with the account that will be used for the integration.
  2. Open Users, then Profile. An administrator can also edit another user’s profile.
  3. Locate the section Application passwords.
  4. Give the access a specific name, such as «Inventory sync – internal server» or «Mobile app – editorial team.».
  5. Generate the password, then copy it immediately to a secure location.
  6. Add it to the configuration of the relevant tool, along with the corresponding WordPress username.

The name matters. It will help you quickly recognize the integration during a review or revocation. So avoid vague names like «API,» «test,» or «external tool.».

Keeping the secret in the right place

WordPress will not show the full password again after creation. Treat it as a sensitive secret. Do not send it in an email, an unprotected message, or a shared document without access controls.

Also, never store it directly in a public Git repo or in a file that will be copied to multiple machines. Use the secret storage mechanism provided by your environment or CI service. Also limit who can view or replace this value.

Check usage and revoke access

Periodically return to the relevant user’s profile. WordPress lists application passwords by name and provides usage details, including last use and last known IP address. These data help confirm that an access is still in use.

Revoke an application password in the following situations:

  • The integration is removed or replaced.
  • An employee, vendor, or device no longer needs this access.
  • The secret was sent to the wrong recipient or may have been exposed.
  • The last use or IP address looks unusual.
  • You are rotating the credential as part of a scheduled rotation.

To remove it, open the same WordPress profile and use the revoke option next to the relevant name. The integration’s access then stops, while the account’s primary password remains unchanged. If you have serious doubt about an access’s use, revoke it first, then review the account’s other accesses.

If you suspect a broader compromise, don’t stop at revocation. Also change the affected credentials, check user accounts, and follow an appropriate incident response plan, such as the one shown in the steps to take after a WordPress hack.

What application passwords do not replace

An application password reduces the need to share your primary password. However, it does not protect an account to which you have granted excessive permissions. It also does not verify the identity of a person logging into the dashboard.

So maintain a strong primary password and additional protection for interactive logins. Two-factor authentication protects the human login to the account, while the application password protects programmatic access by separating it from the primary password.

Finally, this feature does not fix a poorly designed integration. Ensure the tool uses only the necessary API routes, communicates over HTTPS, and does not log the secret. To complete this approach, also apply the best practices described in simple methods to secure WordPress without a plugin.

An easy method to remember

Create a dedicated user when appropriate. Grant them the minimal role. Then generate a separate, clearly named password for each tool. Store each secret in a secure location and revoke it as soon as it’s no longer needed.

This method lets you maintain control over API integrations without exposing your WordPress account’s main password.