How to Use WordPress Application Passwords for REST API Access

Need a script, integration or automation to connect to your WordPress site? WordPress Application Passwords provide a separate credential for API access, so you do not have to share your main account password. This guide explains how to create one, make an authenticated REST API request, store the credential safely, troubleshoot common errors and revoke access when an integration is no longer needed.
What is a WordPress Application Password?
An Application Password is a credential associated with a WordPress user account. It is intended for software that needs to authenticate to WordPress programmatically, such as a deployment script, mobile application or external integration. It is not a password for signing in to the normal WordPress dashboard.
- It is separate from the user’s regular login password.
- It can be named for the application or integration that uses it.
- It can be revoked independently without changing the main account password.
- It uses HTTP Basic Authentication for supported API requests, and those requests must use HTTPS.
Application Passwords have been part of WordPress core since version 5.6. Availability can still be affected by the site’s environment, security configuration or code that disables the feature. See the official Application Passwords handbook.
When should you use an Application Password?
Use one when a trusted external program needs to access the WordPress REST API as a particular user. Typical examples include a content workflow that creates drafts, a reporting integration that reads site data, or a maintenance script that updates permitted resources.
Do not create one just to log in to wp-admin. Browser dashboard sessions use the normal WordPress login and cookie authentication. For a plugin or theme making requests from an already logged-in WordPress user, the REST API’s cookie and nonce approach is generally the appropriate built-in method. The REST API authentication handbook explains both approaches.
Before you create a credential
- Confirm that the site uses valid HTTPS and that the client verifies the TLS certificate.
- Choose the WordPress user whose capabilities are sufficient for the integration, but no more powerful than necessary.
- Decide where the credential will be stored, such as an operating-system secret store or a CI/CD platform’s encrypted secrets facility.
- Give the credential a clear name that identifies the application and environment, such as
inventory-sync-production. - Check whether your host, security plugin or site code disables Application Passwords.
Important: an Application Password inherits the capabilities of its associated WordPress user. Its name does not create a read-only scope. If a script only needs to read content, use an account whose role and capabilities are appropriate for that task rather than attaching the credential to an administrator account unnecessarily.
How to create an Application Password in WordPress
The dashboard labels can vary slightly by WordPress version or site configuration, but the usual process is:
- Sign in to WordPress with the account that the integration will use.
- Open Users → Profile. An administrator with the required permissions can instead edit the relevant user’s profile.
- Find the Application Passwords section near the bottom of the profile screen.
- Enter a descriptive name for the integration.
- Select Add New Application Password.
- Copy the generated value immediately and place it in your approved secret store.
WordPress displays the generated password only at creation time. If you lose it, create a replacement and update the integration; you cannot reveal the original full value later from the profile screen. Do not paste it into a support ticket, chat, source file or screenshot.
Make an authenticated REST API request with cURL
For a basic connection check, the WordPress REST API provides a current-user endpoint. Replace the example placeholders with your own site URL, WordPress username and Application Password. Keep the URL on HTTPS.
curl --user "USERNAME:APPLICATION_PASSWORD" \
--header "Accept: application/json" \
https://example.com/wp-json/wp/v2/users/me
When prompted or when using a secure secret-injection method, supply the generated Application Password rather than the user’s normal login password. A successful authenticated request returns the current user’s permitted REST representation. The exact fields depend on the endpoint and the user’s permissions.
For a read request to posts, for example:
curl --user "USERNAME:APPLICATION_PASSWORD" \
"https://example.com/wp-json/wp/v2/posts?per_page=5"
These are example commands, not a test against your own site. Avoid placing a real password directly in shell history or a command that may be visible to other local users. Prefer a protected secret store or a script that reads the credential securely.
Use Application Passwords from a script
A script should read its username and Application Password from environment variables or a dedicated secret manager rather than embedding them in the source code. The following Python example uses the widely available requests package; install dependencies according to your project’s normal process.
import os
import requests
site_url = "https://example.com"
username = os.environ["WP_USERNAME"]
app_password = os.environ["WP_APP_PASSWORD"]
response = requests.get(
f"{site_url}/wp-json/wp/v2/users/me",
auth=(username, app_password),
headers={"Accept": "application/json"},
timeout=20,
)
response.raise_for_status()
print("Authenticated. User ID:", response.json()["id"])
Set WP_USERNAME and WP_APP_PASSWORD in the runtime environment using your platform’s secret-management feature. Do not commit a real .env file, print the password, or log the Authorization header. If the request fails, inspect the HTTP status and WordPress response body without exposing credentials.
WordPress 7.2: application-password creation email
The WordPress Core developer note for the 7.2 release cycle documents an email notification when an Application Password is successfully added, provided the user has a valid email address and the credential has a name. The notification is intended to make credential creation more visible to the account owner. Sites with custom notification code should review the relevant hooks and filters to avoid duplicate messages.
For implementation details, consult the official WordPress 7.2 developer note. Treat release-cycle notes as version-specific: confirm the actual WordPress version running on your site before relying on a particular behaviour.
How to review and revoke an Application Password
Return to the user’s profile and review the Application Passwords list. WordPress shows information such as the credential name and usage metadata where available. If an integration is retired, a device is lost, or a credential may have been exposed, revoke that specific Application Password.
- Identify the credential by its descriptive name.
- Confirm which application or environment uses it before revoking it.
- Use the revoke control for that credential.
- Update or remove the corresponding secret in the external application.
- Test that the retired credential can no longer authenticate.
Revoking an Application Password does not change the user’s normal dashboard password or automatically end every browser session. If the main account itself may be compromised, handle the account password, active sessions and recovery methods separately.
Common Application Password errors and fixes
401 Unauthorized
Check the username, Application Password and Basic Authentication formatting. Confirm that the credential belongs to that user and has not been revoked. Use the Application Password, not the normal dashboard password.
403 Forbidden
Authentication may have succeeded while the user lacks permission for the requested operation. Check the role and capabilities, endpoint requirements, security plugin rules and hosting firewall logs. A credential does not grant capabilities the user does not already have.
Application Passwords section is missing
Confirm that the profile belongs to the intended user and that the site is served over HTTPS. A plugin, must-use plugin, host configuration or custom filter may disable the feature. Ask the site administrator or host to review the configuration rather than trying to bypass the restriction.
Authorization header is not reaching WordPress
Some proxies or server configurations can strip the Authorization header. Check the reverse-proxy and web-server configuration with the hosting administrator. Do not send credentials over plain HTTP or disable certificate verification as a workaround.
Security checklist
- Use HTTPS and verify certificates.
- Create a separate Application Password for each integration and environment.
- Use a WordPress account with only the capabilities required.
- Store credentials in a secret manager or protected runtime configuration.
- Never commit credentials to Git or expose them in logs, URLs or screenshots.
- Revoke credentials that are no longer needed or may have leaked.
- Review the external integration’s logs and access controls as well as WordPress usage metadata.
Frequently asked questions
Can I use an Application Password to log in to wp-admin?
No. It is designed for programmatic API authentication, not the interactive WordPress login form.
Can I see an Application Password again after creating it?
No. Save it securely when WordPress displays it. If it is lost, create a replacement and revoke the old credential when appropriate.
Does an Application Password make an account read-only?
No. It inherits the capabilities of the associated user. Use an account with suitably limited permissions.
Can I use the same Application Password for multiple tools?
It is safer to create one credential per integration. Separate credentials make it easier to identify usage and revoke one integration without interrupting another.
What should I do if an Application Password leaks?
Revoke it promptly, remove it from the affected secret store and logs where possible, and review the account’s activity and permissions. If the account’s main password or other secrets may also be exposed, address those separately.
Final thoughts
WordPress Application Passwords are a practical way to give scripts and integrations separate REST API credentials without sharing a user’s main login password. Their safety depends on HTTPS, secure storage, sensible account permissions and timely revocation. Start with a low-privilege user, test the exact API operation your integration needs, and keep a simple record of which application owns each credential.
For further reading, see the WordPress REST API authentication guide and the Application Passwords security handbook.





