How to Create WordPress Posts and Do SEO with Claude Code + MCP (Step-by-Step)

Write WordPress posts and do SEO with Claude Code and MCP

Writing a blog post, then filling in the SEO title, meta description, focus keyword, slug, alt text and internal links, can take an hour or more. With a Claude Code WordPress MCP setup, you describe the post in plain English and Claude does the work: it reads your Search Console keywords, writes the post, creates the draft in WordPress, runs Rank Math’s on-page SEO tests and fixes what fails.

In this guide I’ll show you the exact workflow I use on manjray.com, step by step, with a screenshot for every step. If you haven’t connected Claude Code to WordPress yet, start with my guide to connecting Claude Code to WordPress. Step 1 below is a short recap.

What You Can Do with Claude Code WordPress MCP

TaskHow Claude does itTime
Find a post topic from real keyword dataRank Math ability get-top-keywords (Search Console)1 minute
Write a full post with headings, table and FAQWrites an HTML file in your project folder2–4 minutes
Create the draft, category and featured imageWordPress REST API with your application password1 minute
Run on-page SEO testsRank Math ability analyze-post-content1 minute
Set SEO title, description and focus keywordRank Math updateMeta endpoint1 minute
Audit the whole siteaudit-site-seo, get-seo-scores, get-link-report2 minutes

What You Need Before You Start

  • The Claude desktop app with the Code tab (or Claude Code in a terminal)
  • A WordPress site on version 6.9 or newer, where the Abilities API is built in
  • The official WordPress MCP Adapter plugin, installed and active
  • A recent version of Rank Math SEO. It registers its SEO tools as abilities that Claude can use. Connect Search Console in Rank Math if you want keyword data.
  • An application password for an Administrator or Editor account (Users → Profile → Application Passwords)
  • Node.js 20+ on your computer, and a fresh site backup

Step 1: Connect the WordPress MCP Server to Claude Code

Open a terminal and add your site as an MCP server. Replace the URL, username and application password with your own:

claude mcp add-json wordpress --scope user '{"type":"stdio","command":"npx","args":["-y","@automattic/mcp-wordpress-remote@latest"],"env":{"WP_API_URL":"https://yoursite.com/wp-json/mcp/mcp-adapter-default-server","WP_API_USERNAME":"your-admin-user","WP_API_PASSWORD":"xxxx xxxx xxxx xxxx xxxx xxxx","OAUTH_ENABLED":"false"}}'

Then run claude mcp list. You should see wordpress: ✓ Connected. Start a new session in the Code tab so the server loads.

Claude will also use the WordPress REST API to create posts, so save the same login as two environment variables. In PowerShell:

setx WP_USER "your-admin-user"
setx WP_APP_PASSWORD "xxxx xxxx xxxx xxxx xxxx xxxx"

Restart the Claude app after setx so it picks up the new variables. This keeps the password out of your chat and out of your project files.

Claude Code WordPress MCP setup: add the server with claude mcp add-json and check it is connected

Step 2: Check Which WordPress Abilities Claude Can Use

The MCP Adapter only gives Claude the abilities your site registers. WordPress core adds a few, and plugins like Rank Math add more. In the Code tab, type:

List the WordPress abilities you can use on my site.

On my site Claude found 35 abilities: 3 from WordPress core, 29 from Rank Math and 3 from MailPoet. Rank Math’s abilities are the SEO toolbox for this whole guide.

Important: the MCP Adapter alone has no ability to create or edit posts. That’s fine. Claude Code can also run commands, so it creates posts through the normal WordPress REST API with the same application password. MCP handles the SEO intelligence, and the REST API does the writing.

Claude Code lists the WordPress core and Rank Math abilities available through the MCP Adapter

Step 3: Find a Post Topic from Your Search Console Keywords

Don’t guess what to write. Ask Claude to look at your real search data:

Get my top Search Console keywords for the last 28 days and suggest one new post I should write.

Claude calls Rank Math’s get-top-keywords ability and looks for keywords with many impressions but a weak position and no dedicated page. Those are your easiest wins. Pick the topic and the focus keyword before moving on.

Claude Code uses the Rank Math get-top-keywords ability to suggest a new blog post topic

Step 4: Ask Claude to Write the Post

Give Claude a clear brief: title, focus keyword, length, structure and where to save the file. For example:

Write a 1,500-word post “How to Do WordPress SEO with Claude Code”. Focus keyword: ai seo wordpress. Use H2/H3 headings, a comparison table, an FAQ with 5 questions and FAQ schema. Link to my Claude Code guide. Save it to blog-drafts/ai-seo-wordpress.html.

Claude writes the post as an HTML file in your project folder, so you can read it and ask for changes before anything touches your site. Ask for edits in plain English, such as “make the intro shorter” or “add a section on internal links”.

Tip: save your site rules in a CLAUDE.md file in the project folder: brand colors, categories, affiliate link rules, tone of voice, and “always save as draft”. Claude reads it in every session, so every post follows the same rules without you repeating them.

Claude Code writes a WordPress blog post as a local HTML file with headings, table and FAQ

Step 5: Create the Draft in WordPress

When the post looks good, tell Claude:

Looks good. Create it as a draft in WordPress, category AI, and upload featured.jpg as the featured image.

Claude uploads the image to /wp-json/wp/v2/media, then creates the post at /wp-json/wp/v2/posts with "status": "draft". Claude Code asks for your approval before it runs each command. Read the command, then click Allow. Claude replies with the draft’s ID and edit link.

Need a featured image? Ask Claude to design one in Claude Design at 1200×675 with your brand colors, then upload it in the same step.

Approve the curl command that creates a WordPress draft post through the REST API

Step 6: Run Rank Math’s On-Page SEO Analysis

Now check the draft the same way Rank Math does in the editor:

Run Rank Math’s on-page SEO analysis on draft 4012 and tell me what fails.

The analyze-post-content ability returns the post’s content, headings, images, links and the list of Rank Math tests. Claude checks each test and tells you what passes, what fails and how to fix it, for example a missing meta description, no keyword in the SEO title, images without alt text or a slug that is too long.

Claude Code runs the Rank Math analyze-post-content ability and lists failed SEO tests

Step 7: Set the SEO Title, Meta Description and Focus Keyword

Reply “Yes, apply all the fixes.” Claude then:

  1. Saves the SEO title, meta description and focus keyword through Rank Math’s /wp-json/rankmath/v1/updateMeta endpoint (fields rank_math_title, rank_math_description and rank_math_focus_keyword)
  2. Shortens the slug with the posts endpoint
  3. Adds alt text to each image through the media endpoint
  4. Reads the values back with the get-post-seo-meta ability to confirm they were saved

Keep the SEO title under 60 characters and the meta description under 160, with the focus keyword near the start of both.

Claude Code sets the Rank Math SEO title, meta description and focus keyword for a WordPress post

Step 8: Audit Your Whole Site and Fix Weak Posts

The same connection works for your old content too. Ask:

Run a site SEO audit and list my posts with a bad SEO score. Don’t change anything yet.

Claude runs audit-site-seo for the site-wide score, get-seo-scores with the “bad” filter for weak posts, and get-link-report for posts with no internal links. Some site-wide issues, like a missing tagline, can be fixed with fix-site-seo. Then improve weak posts one at a time with Steps 6 and 7.

Claude Code runs a Rank Math site-wide SEO audit and lists posts with a bad SEO score

Step 9: Review the Draft and Publish It Yourself

Open the draft in wp-admin. Read it once, click every link, check the images on mobile with Preview, and make sure the Rank Math score looks right. Then click Publish. I recommend keeping this last click for yourself: Claude saves drafts, you decide what goes live.

Review the Claude-written draft in the WordPress editor and publish it

Copy-Paste Prompts for Posts and SEO

TaskPrompt
Topic ideas“Find keywords where I rank 8–20 with over 1,000 impressions and no dedicated post.”
New post“Write a 1,500-word post on [topic], focus keyword [keyword], with a table, 5 FAQs and FAQ schema. Save it as a draft in category [name].”
Update an old post“Update post [ID] for 2026: refresh prices and dates, fix broken links, keep everything else. Save as a new draft revision.”
On-page SEO“Run analyze-post-content on post [ID] and fix every failing test.”
Missing keywords“List posts with no focus keyword and suggest one for each. Don’t save until I approve.”
Internal links“Find posts with no internal links and suggest 2 relevant links for each.”
Technical check“Show my sitemap status, robots.txt and the top 404 errors.”

Troubleshooting

ProblemFix
No Rank Math abilities in Step 2Update Rank Math to the latest version and make sure the MCP Adapter plugin is active.
get-top-keywords returns nothingConnect Google Search Console in Rank Math → Analytics and wait for data to sync.
401 when creating a postCheck WP_USER and WP_APP_PASSWORD, restart the app after setx, and allow REST API logins in your security plugin.
HPE_INVALID_CHUNK_SIZEYour cache or CDN changes the response. Exclude /wp-json/mcp/* from LiteSpeed Cache and Cloudflare caching.
Inline CSS in the post breaksAsk Claude to use inline styles on elements instead of a <style> block, or keep the CSS on one line.

Safety Tips

  • Always save as draft. Put “never publish, only save drafts” in your CLAUDE.md.
  • Approve each command on a live site, and read what it will change.
  • Use a separate application password for Claude and revoke it from Users → Profile if it leaks.
  • Back up before bulk changes, such as updating many old posts at once.
  • Check facts yourself. Claude writes well, but prices, dates and product details need your review.

Frequently Asked Questions

Can Claude Code create WordPress posts through MCP?

The official WordPress MCP Adapter only exposes the abilities your site registers, and core WordPress does not register a create-post ability. Claude Code creates the post through the WordPress REST API with the same application password, and uses MCP abilities such as Rank Math’s for SEO checks.

Does this work with Rank Math?

Yes. Recent versions of Rank Math register about 29 abilities, including keyword data from Search Console, on-page SEO analysis, site audits, SEO scores and link reports, and Claude Code can use all of them through the MCP Adapter.

Does it work with other SEO plugins like Yoast?

Yes for writing and creating posts. For the SEO tools, ask Claude to list your abilities: if your SEO plugin does not register abilities, Claude can still check titles, descriptions, headings and links itself, but you will not get plugin features like Rank Math site audits or Search Console keywords.

Is it safe to let Claude edit my live site?

Yes, if you use an application password, approve each command, save everything as a draft and publish it yourself. Keep a recent backup before bulk changes.

Do I need to know how to code?

No. You run one command to connect the MCP server and two to save your login. After that you give Claude instructions in plain English.

Final Thoughts

A Claude Code WordPress MCP workflow turns a full post, from keyword research to a draft with a high Rank Math score, into a short conversation. Let MCP and Rank Math handle the SEO checks, let the REST API create the draft, and keep the final review and the Publish button for yourself. Start with one post this week and you’ll see how much time it saves.

0 Comments