The way I build WordPress sites has changed more in the last 18 months than in the previous five years combined. AI tools β€” specifically Claude.ai and ChatGPT β€” have become as fundamental to my workflow as VS Code and Local WP. If you're still not using AI in your WordPress development workflow in 2026, you're working harder than you need to.

Here's exactly how I use AI across every phase of a WordPress project, with specific prompts and real examples.

1. Generating Custom PHP Hooks and Filters

Writing custom add_action and add_filter hooks from scratch is time-consuming. More importantly, it's error-prone β€” the WordPress hook reference is vast and remembering the exact parameters for every filter isn't realistic.

My prompt structure: "I'm using WordPress. I need to [specific goal]. Write a PHP function using add_filter/add_action that [exact behavior]. Use proper WordPress coding standards and include nonce verification if a form is involved."

Example: "I need to add a custom field to the WooCommerce checkout page that captures the customer's company VAT number, validates it on submission, saves it to the order meta, and displays it in the order admin view." β€” Claude produces complete, working code in one response, including the four separate hooks needed for the full flow.

This used to take me 30-45 minutes of documentation cross-referencing. Now it takes 3 minutes of prompt refinement.

2. Building ACF Field Groups with JSON

Advanced Custom Fields stores field group configuration as JSON. Instead of clicking through the ACF UI to create complex nested field groups, I now describe what I need in plain English and ask Claude to generate the ACF JSON export directly.

Prompt: "Generate an ACF field group JSON for a 'Services' custom post type. Fields needed: service_title (text), service_icon (image), service_description (textarea), service_features (repeater with: feature_text text, feature_included true/false), pricing_tiers (flexible content with: basic, pro, enterprise layouts each having: price, billing_period, feature_list repeater). Export format should be importable via ACF > Tools > Import."

This generates a complete, importable JSON file. What used to be 45 minutes of UI clicking is a 5-minute prompt refinement session.

3. Debugging WooCommerce Issues

WooCommerce debugging is where AI saves the most time. When a client reports "the checkout is broken" at 11pm, having an AI that can read a PHP fatal error plus surrounding code and identify the root cause in seconds is genuinely invaluable.

My debug prompt: "Here is a WooCommerce error: [paste error + stack trace]. Here is the relevant code: [paste code]. The site uses WooCommerce 9.x on WordPress 6.8 with PHP 8.2. What is causing this error and what is the fix?"

Claude's strength here is cross-referencing the error with the code context. It identified a WooCommerce 9.x breaking change in how order meta is accessed (moving from $order->get_meta() array format to a new CRUD API) across a 400-line plugin file β€” something that would have taken me an hour to track down manually.

4. Writing Custom WordPress Theme Functions

Custom post type registration, taxonomy setup, REST API endpoint additions β€” these are all repetitive boilerplate that AI handles perfectly. I keep a master prompt template:

"WordPress PHP. Register a custom post type called '[name]' with: public = true, has_archive = true, supports = [title, editor, thumbnail, excerpt], taxonomies = [custom taxonomy names], REST API enabled, admin menu icon = [dashicon name]. Include a separate function to register the taxonomies with hierarchical = [true/false]."

AI-assisted WordPress development workflow β€” using Claude.ai to generate custom PHP hooks and ACF field groups
AI has made repetitive WordPress boilerplate a 2-minute task instead of a 20-minute one.

5. Writing Plugin Documentation and Inline Comments

I used to skip inline documentation on client projects under deadline pressure. Now I paste completed functions into Claude and ask it to add PHPDoc blocks and inline comments explaining non-obvious logic. It takes 30 seconds and makes the code infinitely more maintainable.

Prompt: "Add WordPress-standard PHPDoc documentation to this function. Include @param, @return, @since tags. Add inline comments for any non-obvious logic. Don't over-comment obvious lines."

6. Generating WooCommerce Email Templates

WooCommerce email template customization involves overriding core template files in your theme. The file structure and required PHP variables are well-defined but tedious to set up from scratch.

Prompt: "Create a custom WooCommerce order confirmation email template override for a theme. The template should: match our brand (dark navy #1a1a2e, accent color #e63329), include the order table, billing address, and a custom message thanking the customer for their order. Use proper WooCommerce template structure with woocommerce_email_header and woocommerce_email_footer hooks."

7. Security Code Review Before Client Handoff

Before delivering any custom plugin or theme to a client, I paste the complete code into Claude with this prompt: "Review this WordPress plugin code for security vulnerabilities. Check specifically for: SQL injection, XSS vulnerabilities, missing nonce verification, unescaped output, insecure direct object references, and capability checks on admin functions. List each issue with the line number and the fix."

This has caught real issues β€” unescaped $_GET parameters, missing check_ajax_referer() calls, and wpdb->query() with string concatenation instead of prepared statements. It's not a replacement for proper code review, but it's an excellent first pass.

The Honest Limitation

AI doesn't understand your specific site's state. It doesn't know what plugins are active, what your theme's template hierarchy looks like, or what custom database tables you've added. You still need to provide that context explicitly in your prompts. The more context you give, the better the output.

Treat AI like a highly competent developer who just joined your team but doesn't know your codebase yet. Brief them thoroughly and verify their output β€” but they'll move fast once they're up to speed.

Ready to put these skills to work? Take a look at my WordPress development services or get in touch to discuss your project.

Related Service

πŸ’» Web Development

Custom websites and web applications built with PHP, Laravel, WordPress, and React β€” fast, secure, scalable, and tailored to your business goals.

Explore Web Development →