Have you ever hesitated to connect a Python script, CI/CD runner, or third-party app to your WordPress site because you did not want to hand over your main admin password?
Sharing your primary login across scripts is a major security risk, because one leaked .env file compromises your entire dashboard.
The good news is that WordPress solves this natively with Application Passwords. Introduced in WordPress 5.6, they give each external tool its own revocable 24-character key for REST API requests. In this guide, we explain how Application Passwords work and how to use them safely in headless workflows.
Executive Summary
- Built-In Since WordPress 5.6: Application Passwords require zero plugins and live inside every user’s WordPress profile.
- Per-App Revocation: Each script or integration gets a unique 24-character password that you can revoke in one click without changing your main login.
- API-Only Access: Application Passwords work with the REST API and XML-RPC over HTTP Basic Auth, but they cannot be used to sign in to the
/wp-admin/login screen. - HTTPS Enforced: WordPress blocks Application Passwords on live
http://sites by default so credentials are never sent in plain text.
Table of Contents
- What Is a WordPress Application Password?
- Application Passwords vs. Primary Logins vs. JWT
- How Application Passwords Work Under the Hood
- How to Create and Revoke an Application Password
- 5 Security Rules for Headless and CI/CD Pipelines
- Frequently Asked Questions
- You May Also Like
- Primary Sources and References
What Is a WordPress Application Password?
A WordPress Application Password is a 24-character token generated by WordPress for a specific external app or script. Instead of typing your real account password into an automation tool, you pair your WordPress username with that generated token.
WordPress displays the password once in six four-character groups (such as abcd efgh ijkl mnop qrst uvwx). Internally, WordPress strips the spaces and hashes the value just like a normal password before saving it in user metadata.
Because each password is tied to an app label you choose (like GitHub-Actions-Deploy or TeckScaler-CLI), you can track exactly which integrations have access to your site.
Application Passwords vs. Primary Logins vs. JWT
Choosing the right authentication method depends on whether you are running backend scripts or building a user-facing mobile app.
| Method | Setup Effort | Revocable Per App | Works on /wp-admin/ Login | Best Use Case |
|---|---|---|---|---|
| Primary Account Password | Built-in | No (affects all tools) | Yes | Human dashboard logins only |
| Application Passwords | Built-in (WordPress 5.6+) | Yes (1-click per key) | No (API requests only) | Python scripts, CI/CD, Zapier, headless sync |
| JWT / OAuth Plugins | Requires plugin | Depends on plugin | No | Mobile apps with end-user login flows |

How Application Passwords Work Under the Hood
When a script sends a request to /wp-json/wp/v2/posts, it includes an HTTP Authorization: Basic <base64> header containing username:application_password. Over TLS (HTTPS), that header is encrypted in transit between your script and the server.
WordPress checks three things before accepting the request:
- SSL Check: WordPress verifies
is_ssl()is true (unless the environment is explicitly set tolocal). - Hash Verification: WordPress hashes the incoming Application Password and compares it against the stored list for that user.
- Last Used Tracking: Once verified, WordPress records the timestamp and client IP address on that specific Application Password entry so you can audit recent activity.
Note: Application Passwords inherit the exact role and capabilities of the WordPress user who created them. If you only need a script to create drafts, consider generating the key under an Author or Editor account rather than a full Administrator.
How to Create and Revoke an Application Password
You can manage Application Passwords directly inside the WordPress dashboard with no code required.
Step 1: Open Your WordPress User Profile
Log in to WordPress and click Users > Profile in the left sidebar. Scroll down to the Application Passwords section near the bottom of the screen.
Step 2: Generate a Named Key
Type a descriptive name for your script, such as Python-Publisher-Prod, and click Add New Application Password. Copy the 24-character password immediately and store it in your password manager or .env secrets file.
import base64
# Always strip spaces from the 24-character password before encoding
token = base64.b64encode(b"wp_user:abcdefghijklmnopqrstuvwx").decode("utf-8")
headers = {"Authorization": f"Basic {token}"}Step 3: Audit and Revoke Old Keys
Below the generator box, WordPress lists every active Application Password along with its Created date, Last Used date, and Last IP. If an employee leaves or a server is retired, click Revoke next to that single key without disrupting any other running integration.
Pro Tip: Never commit
.envfiles containing Application Passwords to Git. Store them in encrypted CI/CD secrets (such as GitHub Actions Secrets) and rotate keys every 90 days.
5 Security Rules for Headless and CI/CD Pipelines
Follow these practices to keep automated WordPress workflows locked down:
- Use Least-Privilege Accounts: Create a dedicated service user (such as
api-publisher) with only the Editor role instead of using your personal Administrator account. - One Key Per Integration: Never reuse the same Application Password across local laptops, staging servers, and production runners.
- Enforce HTTPS Everywhere: Keep
WP_ENVIRONMENT_TYPEset toproductionon live sites so WordPress rejects unencrypted API auth attempts. - Combine with WAF IP Rules: If your publishing script runs from a fixed server IP, restrict
/wp-json/wp/v2/POSTrequests in Cloudflare WAF to that IP. - Audit Last-Used Dates Monthly: Review your Users > Profile table once a month and revoke any key you no longer recognize.
Frequently Asked Questions
Can someone log in to the WordPress admin dashboard with an Application Password?
No. WordPress restricts Application Passwords to API authentication (REST API and XML-RPC). Entering an Application Password on /wp-login.php will fail.
Do Application Passwords work if I enable Two-Factor Authentication (2FA)?
Yes. One of the biggest reasons WordPress introduced Application Passwords was to let headless scripts authenticate without triggering interactive 2FA prompts, while keeping 2FA active on your human /wp-login.php form.
Why is the Application Passwords section missing from my WordPress Profile?
WordPress hides the Application Passwords interface if your site is not running over HTTPS (and is not a local environment), or if a security plugin or wp_is_application_passwords_available filter has disabled it.
How many Application Passwords can one WordPress user create?
WordPress does not enforce a strict hard cap in core, so you can create separate keys for every script, staging runner, and webhook integration you manage.
You May Also Like
We hope this guide helped you understand how WordPress Application Passwords secure headless workflows. Written by the TeckScaler Editorial Engineering Team. Complete the full WordPress REST API series with our other guides:
- Automate WordPress Publishing via REST API: Complete Guide.
- How to Post Gutenberg Blocks with Python and WP REST API.
- Fix 401 and 403 WordPress REST API Errors on LiteSpeed.
- WordPress REST API vs WPGraphQL vs XML-RPC Compared.
Primary Sources and References
- Application Passwords Integration Guide (Make WordPress Core)
- WordPress 5.6 Application Passwords Documentation (Official WordPress.org Documentation)
- WordPress REST API Handbook: Authentication (Official WordPress Developer Resources)



