You have seen the demos. An AI agent writes your drafts, updates your product descriptions, and tidies up your metadata while you sleep. Then you try to actually give it access to your WordPress site, and you hit the real question: do you hand over your admin password?
No, and you never should. WordPress has a purpose-built answer: application passwords. I use them every day to let agents edit rerealize.com without ever exposing my login. By the end of this guide you will have an agent connected, a scoped account so a bug cannot wreck your site, and the habits that make the whole thing safe to leave running.
What an application password actually is
An application password is not your login password. Since WordPress 5.6, every user can generate one from their profile. It is a 24-character passphrase, grouped in blocks of four, that exists only to authenticate API requests.
Three details matter, and most tutorials skip them:
- It is stored hashed. WordPress keeps only a hash, exactly like your real password. You see the plain passphrase once, at creation. Lose it and you generate a new one.
- It is sent with HTTP Basic auth over HTTPS. The passphrase travels in the Authorization header on every request. WordPress disables application passwords on sites without SSL, so a plain http:// install silently rejects every attempt with a 401.
- It acts as the user it belongs to. Every request is treated as that account, which means the account role and capabilities decide what the agent can and cannot do. An Editor cannot install a plugin. An Administrator can.
That last point is the whole game. The password authenticates. The role authorizes.

Level 1: Connect your agent in five minutes
Start by creating the credential. In your WordPress admin go to Users, Profile, scroll to Application Passwords, name it something you will recognize later (I use the tool name, like “OpenClaw agent”), and click Add New Application Password. Copy the passphrase immediately, spaces included.
Now prove it works before you wire up any agent. One curl command tells you everything:
If you get that JSON back, the credential is live and the account is valid. A 401 Unauthorized almost always means one of two things: the spaces were stripped out of the passphrase, or the account you are authenticating as has been disabled.
Level 2: Give the agent its own account
Here is the mistake almost everyone makes: they generate the application password on their own admin account. That means a buggy script, a leaked key, or a confused agent has the keys to your entire site.
Instead, create a dedicated user. I call mine editor-agent. Give it the Editor role, not Administrator, then generate the application password on that account.
Why Editor? An Editor can create, edit, and publish posts and pages, and upload media. That covers 95 percent of what you want an agent to do. What it cannot do is the dangerous stuff: install or delete plugins, switch themes, edit users, or touch site settings. If the credential ever leaks, the blast radius is a handful of posts, not your whole business.
If you run WooCommerce, go one step further and give the agent a custom role that includes only the capabilities it needs. Creating products, yes. Processing refunds, probably not.
Level 3: Automate a real task
With the scoped account in place, your agent talks to the WordPress REST API. Everything lives under /wp-json/wp/v2/: posts, pages, media, categories, tags, users, comments.
Here is the exact request that creates a draft post. It is the same call your agent will make, authenticated with its own application password:
The response returns the new post ID, which the agent can immediately reuse to attach a featured image, set categories, or write SEO metadata through the same API. Media uploads follow the same pattern, with a Content-Disposition header telling WordPress the filename.
Because the credential belongs to the editor-agent account, every post it creates is attributed to that author. That is a feature. Filter your post list by author and you can see exactly what the agent produced, then review it before it goes anywhere near the front page.
What else the API opens up
Once the handshake works, the same credential reaches every endpoint the account role allows:
- Posts and pages: create, update, schedule, and draft content, including categories and tags.
- Media: upload images and set alt text, which pairs nicely with automated alt text generation.
- SEO fields: Yoast and Rank Math both expose their meta through REST, so an agent can write titles and meta descriptions.
- Comments: list, approve, or spam reviews, useful if you still moderate by hand today.
Notice what is missing: plugins, themes, users, and site settings. Those need an Administrator, and your agent should not be one. That boundary is the whole reason this approach is safe.
Level 4: Lock it down
Connecting an agent is easy. Keeping it safe over months is the part that matters.
- One password per tool. Give every agent and script its own application password. When one goes bad you revoke that one and nothing else breaks.
- Revoke instantly. Clicking Revoke in the profile section kills the credential on the next request. No cache, no grace period.
- Force HTTPS if you have not already. Application passwords are a no-op without it, and that fix is a hosting and SSL concern, not a code concern.
- Watch the revisions. Every change an agent makes shows up in the post revision history under the agent author name. If something looks off, that is your audit trail.
- Back up before you let an agent delete anything. This is the step that saves you.
If reviewing every change sounds like a chore, our guide to automating WordPress maintenance with an AI agent shows how to hand off the routine work while keeping the final say.
If your hosting is the bottleneck: Kinsta keeps your site safe with automatic daily backups and one-click restore, so a bad update or a hack is a rollback, not a rebuild. Their support is top tier, and 24/7 live chat is staffed by WordPress engineers who will help fix the actual problem with you, so you are not stuck waiting on your developer to reply. Plans start at $35 per month.
Common Mistakes
- Using the admin app password. The single biggest risk. Scope it down to an Editor or Author and sleep better.
- Dropping the spaces. The passphrase is four groups of four with spaces. Most clients accept it as-is, but copying from a tool that trims whitespace breaks it.
- Testing over http://. WordPress refuses to authenticate. You end up chasing a 401 that is really an SSL problem.
- Pasting the passphrase into a public repo or chat. Treat it like a password, because it is one.
- Assuming it grants full access. It does not. The role decides, and that is the point.
- Not finding the menu at all. Some security plugins and hosts hide the Application Passwords section. If it is missing from the profile page, check your security plugin first. Our WordPress security fix guide walks through the usual culprits.
Check out our practical guide to using ChatGPT with WordPress, from drafting posts to cleaning up metadata without breaking your site.
Read the ChatGPT for WordPress GuideFrequently Asked Questions
Yes, when you scope them. An application password on a dedicated Editor account gives the agent exactly the access it needs and nothing more. Revoke it and access disappears instantly.
Usually one of three causes: the passphrase spaces were stripped, the site is not running HTTPS (WordPress disables application passwords without SSL), or the user account is disabled. Test with curl against /wp-json/wp/v2/users/me to isolate it.
No. They stay valid until you revoke them. That is exactly why one credential per tool and periodic review matter, because a forgotten key is a permanent open door.
Only if the account it belongs to has that capability. Give the agent an Editor or Author role and it cannot install, delete, or update plugins.
WordPress does not hard-limit them, and each one is tracked separately with a name, creation date, and last-used time. Use that last-used column to spot credentials you no longer need.
Final Thoughts
Connecting an AI agent to WordPress is a five minute job once you understand the mechanism. The interesting part is not the connection, it is the discipline around it: a dedicated account, a scoped role, one password per tool, and backups underneath all of it.
Set that up once and you can let agents work your site for months without lying awake about it. Start with Level 1, verify with curl, and scope down before you scale up.

