DEV Community

Cover image for AI Wrote the WordPress Code. I Still Had to Make the Important Decision.
Sameer Mulla
Sameer Mulla

Posted on

AI Wrote the WordPress Code. I Still Had to Make the Important Decision.

I gave AI a WordPress development requirement.

It understood the requirement.

It generated the PHP.

The code worked.

There were no obvious errors.

So I had a simple question:

Should I use it?

My answer was:

Not yet.

Not because the code was bad.

The real problem was that I hadn't decided where the code belonged.

  • Should it go into functions.php?
  • Should I create a custom plugin?
  • Should it be an MU-plugin?
  • Should it extend an existing plugin?
  • Or is it actually theme-specific functionality?

That's where the interesting part of AI-assisted development begins.

The Problem Isn't Writing the Function Anymore

Before AI, developers spent significant time figuring out how to implement a feature.

Now, AI can often produce a working implementation in seconds.

But WordPress development isn't only about writing PHP.

It's also about answering questions like:

  • Who owns this functionality?
  • Should it survive a theme change?
  • Can I reuse it on another project?
  • What happens when the client changes themes?
  • Should it depend on WooCommerce or ACF?
  • Does this belong to presentation or business logic?
  • Will this become technical debt later?

AI can help answer these questions.

But the developer still owns the architectural decision.

A Real Example

Imagine a client asks:

"We need a Products section with custom fields and an API integration."

AI can easily generate code inside:

functions.php

And technically, it may work perfectly.

But let's ask a better question:

If we replace the theme next year, should the Products functionality disappear?

Obviously not.

The functionality should survive the theme.

That points us toward a plugin.

WordPress
│
├── Theme
│   └── Presentation
│
└── Plugin
    └── Product functionality
Enter fullscreen mode Exit fullscreen mode

Now the architecture has a clear boundary.

The Rule I Use

I ask:

If I remove the theme, should this functionality still exist?

If yes → Plugin

If no → Theme

It's not an absolute rule for every WordPress situation, but it's a very useful first architectural test.

Where AI Changes the Developer's Role

AI is getting better at implementation.

That means developers need to become better at:

Architecture → Decisions → Trade-offs → Review → Maintenance

The value isn't disappearing.

It's moving upward.

A developer who only knows how to write a PHP function may become less valuable as AI gets better at generating PHP.

A developer who can decide:

  • what should be built,
  • where it should live,
  • how it should interact with WordPress,
  • how it should be secured,
  • how it should be reused,
  • and how it should evolve,

still has a very important role.

So, Is AI Smarter Than Humans?

Maybe AI will eventually outperform developers at many individual programming tasks.

But that's not the most useful question.

The better question is:

Are developers using AI to replace their thinking—or to amplify it?

I don't want AI to simply write more code for me.

I want it to help me make better decisions before I write the code.

That's a very different way of working.

My AI Prompt

Instead of asking:

"Create this WordPress function."

I prefer:

"Act as a senior WordPress architect. Analyze this requirement first. Decide whether it belongs in a plugin, child theme, MU-plugin, or existing plugin. Explain the architectural reasoning and trade-offs. Then design the file structure and generate production-ready code."

That changes the conversation completely.

Final Thought

AI can generate the function.

AI can generate the plugin.

AI can even generate the child theme code.

But someone still needs to decide what belongs where.

And perhaps that's one of the biggest changes AI is bringing to software development:

The less expensive code becomes, the more valuable good architecture becomes.

Top comments (0)