Novamira HQ in beta: all your WordPress sites, one connection for your AI. Get it free →

← All guides

Guide

How to connect OpenAI Codex to WordPress

Updated October 17, 2026 · by the Novamira team

OpenAI Codex is OpenAI’s coding agent for the terminal and desktop, and it connects to WordPress the same way other coding agents do: through an MCP server for WordPress or through the Novamira CLI. This guide covers both routes, the setup step by step, and the errors that come up most often. One note on names: OpenAI Codex, the agent, has nothing to do with the old “WordPress Codex” documentation wiki.

Can OpenAI Codex work on a WordPress site?

Yes. Connected through Novamira, OpenAI Codex can read and write posts and pages, build Elementor and Bricks layouts, manage plugins, query the database and run PHP on the site, with each tool call visible before it runs. The connection is direct between your machine and your site.

Which connection method should you choose?

Route Setup Best for
Novamira CLI One install, one login per site Terminal work, especially on several sites
MCP with OAuth One block in config.toml, then codex mcp login A single site, standard MCP setup
Custom MCP server on the REST API You build and host it Teams with specific needs and time to maintain code
SSH and WP-CLI Shell access to the server Server administration, no structured WordPress tools

The first two are the practical ones. The Novamira CLI is built for coding agents in the terminal: it keeps a profile per site and reconnects on its own when a grant expires. The MCP route is one config block and works with both the OpenAI Codex CLI and the desktop app. The other two exist, but a custom server limits the agent to what the REST API exposes, and plain SSH leaves it improvising with shell commands instead of calling structured WordPress tools.

What do you need before you start?

  • A WordPress site on HTTPS with the Novamira plugin active, free from the download page.
  • An administrator account on the site.
  • OpenAI Codex installed, as CLI or desktop app, with your OpenAI account.

How to set up OpenAI Codex with the Novamira CLI

Install the CLI (requires Novamira 1.11.0 or later on the site):

# macOS / Linux
curl -fsSL raw.githubusercontent.com/use-novamira/novamira-cli/main/install.sh | sh

# Windows (PowerShell)
irm raw.githubusercontent.com/use-novamira/novamira-cli/main/install.ps1 | iex

The installer asks which agent you use and wires OpenAI Codex up. Connect a site by giving the CLI its URL and approving the sign-in from your browser; over SSH or in a container, the CLI shows a device code instead, which you approve from any device where you are signed in to the site. From then on, you just describe the task and OpenAI Codex calls the site’s abilities through the CLI.

How to connect OpenAI Codex via MCP

Add this block to your config.toml, then run codex mcp login and approve the sign-in from your WordPress login:

[mcp_servers.novamira-your-site]
url = "https://your-site.com/wp-json/mcp/novamira-oauth"

The Novamira > Configuration page in your WordPress admin generates this block with your real site URL, ready to copy. Authorizations are listed under Novamira > Manage Connections, where revoking takes effect immediately.

Watch it in action

This independent session by Paul Charlton at WPTuts shows Novamira Pro working with OpenAI Codex on a live demo:

A workflow that holds up

Build where mistakes are cheap, review on the rendered site, then deploy through your own process. Novamira is recommended for staging environments with backups, and Read Mode in Novamira Pro covers read-only inspection on live sites. The Claude Code guide walks through this in more detail.

Common errors and how to fix them

codex mcp login fails or hangs. Check the server URL in config.toml for typos and confirm the site answers on HTTPS; OAuth requires it.

The connection times out on some hosts. Some hosts filter traffic from cloud AI providers; the docs cover what to do when your host or a firewall blocks the connection.

The CLI route fails on an older stack. The Novamira CLI requires WordPress 6.9 or later and Novamira 1.11.0 or later on the site.

A tool call is refused. Check which features are enabled under Novamira > Features, and whether Read Mode is active on that site: with Read Mode on, everything that changes content, files and settings is not offered, and refused if something calls it anyway.

Next steps

Give OpenAI Codex a first real task on a staging copy: an audit of the installed plugins, or a landing page in your builder. The tools page lists every ability it can call, and the connection docs cover every client and route in one place.