Get the plugin
WP MCP/Guides/Guide

By · Published · Updated

WordPress Application Passwords: Create, Use and Revoke

Application passwords let a script, an app or an AI client sign in to WordPress as a user without knowing that user’s real password. This guide covers how they work, how to create and test one, and how to use one safely.

What an application password is

Application passwords have been part of WordPress core since version 5.6. The facts that matter:

  • Per user. Each one belongs to a single WordPress user and acts with that user’s role and capabilities.
  • For API requests only. It works for the REST API and XML-RPC. It cannot be used on the login screen, so it does not give anyone access to wp-admin.
  • Revocable on its own. Revoking one does not change the user’s main password or any other application password.
  • Shown once. WordPress stores only a hash. After you leave the screen you cannot retrieve it.
  • 24 characters, shown in groups of four, like xxxx xxxx xxxx xxxx xxxx xxxx. The spaces are for readability and are ignored when the password is checked.

Requirements

The site must be served over HTTPS. The exception is a development site whose environment type is local, which you can set in wp-config.php:

define( 'WP_ENVIRONMENT_TYPE', 'local' );

Only do that on a machine that is not reachable from the internet. Over plain HTTP the password would travel unencrypted on every request.

Create an application password

  1. In wp-admin go to Users > Profile. To create one for someone else, open Users, edit that user, and use the same section there.
  2. Scroll to Application Passwords.
  3. Type a name in New Application Password Name. Name it after the client that will use it, for example claude-code.
  4. Click Add Application Password (older versions label it Add New Application Password).
  5. Copy the password that appears and store it in a password manager. It is not shown again.

The table below the form lists every application password for the user, with when it was created, when it was last used and the last IP address that used it.

Test it with curl

Ask the REST API who you are. Use the user’s login name (or email address) and the application password:

curl --user "your-username:xxxx xxxx xxxx xxxx xxxx xxxx" https://your-site.com/wp-json/wp/v2/users/me

A JSON object with that user’s id and name means the password works. A 401 response means WordPress did not accept the credentials; see troubleshooting below.

Revoke an application password

  1. Go to Users > Profile and scroll to Application Passwords.
  2. Click Revoke on the row for that password.
  3. To remove them all, use Revoke all application passwords.

Revoking takes effect on the next request. Any client still using the password starts getting 401 responses.

Connect an AI client to WordPress with one

WP MCP turns a WordPress site into an MCP server, so an AI client can read and change the site as a WordPress user. It accepts core application passwords, with no separate API key system. The user needs at least the edit_posts capability.

1. Encode the credential

MCP clients send a Basic authorization header, which is the base64 encoding of username:application-password:

echo -n "your-username:xxxx xxxx xxxx xxxx xxxx xxxx" | base64

The -n matters: without it a newline is encoded too and the result is wrong. Copy the output as a single line.

2. Add the server to your client

For Claude Code, run one command in your project directory:

claude mcp add --transport http wpmcp https://your-site.com/wp-json/mcp/wpmcp-server \
  --header "Authorization: Basic BASE64_OF_username:application-password"

Or add the entry to .mcp.json in the project root. Cursor takes the same entry in .cursor/mcp.json:

{
  "mcpServers": {
    "wpmcp": {
      "type": "http",
      "url": "https://your-site.com/wp-json/mcp/wpmcp-server",
      "headers": {
        "Authorization": "Basic BASE64_OF_username:application-password"
      }
    }
  }
}

Replace your-site.com with your domain and BASE64_OF_username:application-password with the string from step 1.

Claude Desktop does not read an entry with a url, so it uses a downloadable bundle or a bridge entry instead; both are on the Claude and WordPress page. The full Claude Code walkthrough is on Claude Code and WordPress, and Cursor is on Cursor and WordPress. The Claude clients are the most tested path.

3. Verify

Ask the client to call list-post-types or list-posts. A result means the connection and sign-in work.

Security practice

  • One password per client. Give each client its own, named after it, so you can revoke one without breaking the others and see which was last used.
  • A dedicated user. Create a user for agent or script access instead of using your own administrator account, and give it only the role the job needs. An Editor can manage content without touching plugins or settings.
  • Revoke when done. A password for a one-off migration should not outlive it.
  • Never commit it. A base64 string is encoding, not encryption: anyone who reads it can decode the password. Keep .mcp.json out of version control when it holds a real credential.
  • Watch the Last Used column. An unexpected date or IP address is a reason to revoke.

MCP security for WordPress goes further into what an agent should and should not be allowed to do.

Troubleshooting

The Application Passwords section is missing

  • The site is not on HTTPS. WordPress then shows a notice that the feature requires HTTPS instead of the form. Move the site to HTTPS, or set the environment type to local on a development machine.
  • A security plugin or custom code disabled it. Core has a filter, wp_is_application_passwords_available, and some security plugins use it to turn the feature off. Look for an application passwords setting in the plugin. A related filter, wp_is_application_passwords_available_for_user, can hide it for specific users.

401 errors

  • The host strips the Authorization header. Some servers running PHP in CGI or FastCGI mode do not pass the header to WordPress, so the request arrives with no credentials. On Apache, WordPress adds this rule to its own .htaccess block; re-saving Settings > Permalinks rewrites that block if the rule is missing:
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  • Wrong username. Use the user’s login name or email address, not the display name and not the name you gave the application password.
  • Bad base64. Rebuild the string with echo -n, and make sure the output was not wrapped onto a second line.
  • The password was revoked. Create a new one.
  • Spaces are fine. They are not the cause; WordPress ignores them.

If the sign-in works but WP MCP tools answer 403, the user’s role lacks the capability the tool needs.

When OAuth is the alternative

An application password is a long-lived secret pasted into a config file. That suits command-line and editor clients. Some clients cannot send one at all: ChatGPT and the claude.ai custom connector sign in with OAuth only.

WP MCP ships an OAuth 2.1 server for those clients. It is off by default, and a site administrator switches it on with one line in wp-config.php:

define( 'WPMCP_OAUTH_ENABLED', true );

With OAuth, you sign in to WordPress in a browser and approve the client, and you can choose read-only access at that step. The ChatGPT route works through OAuth once it is enabled but is not fully tested yet; see ChatGPT and WordPress. MCP OAuth explained covers how the flow works and when to prefer it.

Next step

Create a dedicated user, add one application password named after your client, and run the curl test above. When it returns your user, follow Add an MCP server to Claude Code to connect it.

Common questions

What is a WordPress application password?

It is a separate, revocable password tied to one WordPress user, built into core since WordPress 5.6. Scripts and apps use it to sign in to the REST API as that user. It cannot be used to log in to wp-admin.

Where do I find application passwords in WordPress?

In wp-admin go to Users > Profile and scroll to the Application Passwords section near the bottom. An administrator can also create one for another user from that user's edit screen.

Why is the application passwords section missing?

The feature needs HTTPS, or a site whose environment type is set to local. If the site is on HTTPS and the section is still missing, a security plugin or custom code is switching it off through the wp_is_application_passwords_available filter.

Are application passwords safe?

They are safer than sharing your login password: each one is stored hashed, works only for API requests, and can be revoked on its own. It still carries the full permissions of its user, so use a dedicated user with a limited role and keep the password out of version control.

Do the spaces in an application password matter?

No. WordPress shows the 24 characters in groups of four to make them readable and ignores the spaces when it checks the password. You can send it with or without them.

Can I see an application password again after creating it?

No. It is shown once, when you create it. If you lose it, revoke it and create a new one.

All WP MCP guides, or see every plugin integration. Topic: Get started and stay safe.