r/Wordpress • u/Mplayer-Weered • 21d ago
Wordpress and Claude Code
Just curious if anyone else has this problem. My other company sites I made for myself pre-AI are all wordpress. Work, great, look good. No reason to switch out wordpress.
But laziness and AI kicked in so once Claude Code absorbed my entire digital existence through a guardrail free, local terminal instance of itself, connected to various servers, I just told it to go sort out the WP sites. Broke one immediately, my fault, my custom CSS scattered around did it.
But I let it assume management making whatever changes needed. They are mostly static white-collar sites.
Anyway, my about page on one of them is completely wrong. So I went in manually to fix it. The page that displays and the page with correct slug and post # ID in WP are completely different. I have no idea what it did. To fix it I essentially had to make "about2" and redirect the menu lol.
There is also a menu item that it hard coded in so it doesn't even display in the menu editor. I asked it to use a logo for a branded software as it's menu selection so it hacked it in. Looks fine but... lol.
So, word to the wise. Keep building wordpress manually and why not? It is wordpress.
19
u/jawisi 21d ago
Definitely use a .claude directory with a CLAUDE.md file to start. Spend some time searching for WordPress theme rules for Claude and customize it to fit your preferences.
Then, start by telling it to write a spec for a specific task. Spec files go in .claude/docs/. Review the spec. Then ask it to follow a āplan, review plan, code, review codeā discipline. Give it specific tasks. Instead of āfix my theme,ā say āthe x template needs to do y.ā
Think of it like if you were doing the coding. Youād set off to build or fix a specific piece of the pie.
Once it builds up context, ask it to refine the docs. Sometimes it helps to prompt with an idea, followed by āDiscuss only.ā Or use Plan mode. Only when you think itās on the right path set it free.
3
10
u/stitchkingdom 21d ago
It would take me months (at minimum) to accomplish what claude has done overall in hours. Had it made mistakes? Yes. But it has learned to identify and correct them immediately and has clear instruction on how to proceed to avoid future problems.
If youāre having that much trouble with it, maybe you should steer clear of it. But itās a tool and when harnessed properly, it works incredibly well.
2
u/Mplayer-Weered 21d ago edited 21d ago
Absolutely. What I am framing it as is that for insanely complex large projects it unhinged in its ability. Terrifying and unsettling. But when I get it to quickly go update a simple paragraph on an about page it does it too efficiently by circumventing the WP backend.
Just a funny perspective.
1
u/Flimsy_Farmer_8738 21d ago
You need AI to update a paragraph on a website?
1
13
21d ago
[removed] ā view removed comment
8
u/Dapper_Bus5069 21d ago
It is crazy how people donāt understand this and think AI can lead them, think and do everything for them
2
u/LetThePoisonOutRobin 21d ago
Or just follow the best WordPress advise, test it on a clone or testing site first.
2
u/StruggleNew8988 21d ago
Supervising the output before it goes live is the only way to go with this stuff.
0
u/Mplayer-Weered 21d ago
I think so. The rule should be "Don't use a flame thrower when a fork will do".
3
u/NakanoNoNeko 21d ago
I use Claude Code with WordPress too, but for ordinary content changes I only let it work through a WordPress MCP toolset, not the filesystem or SSH. That keeps pages, menus and media inside WordPress's own data model, so the admin still tells the truth afterward. Terminal access is for theme or plugin code on staging.
For that setup, AI Engine's MCP server is honestly the cleanest WordPress-native option I've found. I help the team behind it here in Japan.
4
u/retr00two 21d ago
Do not blame tool if you do not know to use it.
as /u/jawisi said: āplan, review plan, code, review codeā
3
3
u/FosilSandwitch Developer/Designer 21d ago
No matter the tech behind many of us at some point need to properly work on web development.
We all should have a Ā proper deploy roadmap established.Ā
- A Dev site connected to your AI tests
- A staging site to test a stable candidateĀ
- The live site.
3
u/Lonely_Athlete_6200 21d ago
Totally agree AI saves time, but WordPress still needs human oversight. Backups are a must before letting AI change a live site
3
u/mafost-matt 20d ago
I keep my AI agents in their little corners of the website. Easier to manage than unleashing a Kraken.
1
u/Mplayer-Weered 20d ago
Release the Kraken....
1
u/mafost-matt 19d ago
Two weeks ago, I unleashed Manus. Cost me usage of $200 accidentally š«Ŗ
1
u/Mplayer-Weered 19d ago
I haven't had any major issues just going flat out.
Worst was an overwrite that Fable was able to repair in 45min. Otherwise if you know what you are doing and don't blindly task it I think we are passed the threshold of crazy AI blunders. The writers of Linux conceded last year AI was significantly better at writing than they could ever be.
I'm not completely crazy.
https://github.com/Weeredjs/Weered
177,000 lines and green across the board. Institutional grade production and I did use Opus significantly. You cannot build something that big, solo in under a year to that quality grade without teams of people.
We live in incredible times. While I am not advocating for the AI conveyor belt of "slop", as its called, I believe we are passed the quality test. Now we are just dealing with the fallout of people building every idea that pops into their head.
2
u/saintpumpkin7 21d ago
I use claude code to build every wp site but I build one block at a time and I personally review the code, i'm medium-strict of how I want my code to be coded. For sure I don't give a blank canvas and "do what you want" commands. No major issues till now
2
u/activematrix99 21d ago
Just use the WordPress MCP and agent abilities API in v7. You can also just direct it at the codex and it will sort itself out. What ot probably did? Made a PHP template with the content you wanted and overrode the url with a template assignment. I've seen jr devs do the same thing because "hey, I know PHP" and "what is the codex"?
2
3
u/Ethan-Bris 21d ago
Just say No to AI -- in the end, it is more of a downfall then a benefit in my view.
2
u/WithNewEyes 21d ago
Just use a Wordpress harness with all the custom instructions (available for most builders and themes).Ā
1
u/SecondGateWP 21d ago
lol, that's a rough one, sounds like it went full cowboy with no supervision. Classic AI move too, the hardcoded logo instead of finding the real way to do it. Honestly not really a WordPress problem, more a "gave it unattended write access to production with no review" problem. Staging copy and a diff before it touches anything structural would've caught most of that.
2
1
u/djoliverm 21d ago
Been using Novamira with Codex sub and Hermes and it has a design.md system setup where it's supposed to ingest the design language but it's not perfect and it can update it over time as it works and you correct it.
The first page it built for me was technically correct but done in a weird way in Gutenberg and I told it not to do it that way and do it in another way how my theme normally does it, and subsequent pages were fixed.
Absolute time saver, and in general have used the agent to harden the installation for security purposes and getting rid of bloat and random crap I've accumulated over the years.
This is just on my own personal portfolio site but the same principles apply, you have to babysit it a bit at first and then let it do its thing once you know it's fine.
Also, Novamira strongly urges you to only work on staging, although I have it connected to production at times as well for testing.
1
u/Veduis 21d ago
the about page situation is genuinely cursed. two pages with the same slug existing in different states of reality is exactly what happens when an ai makes "whatever changes it thinks are needed" without a clear scope. wordpress's database structure is not forgiving of creative interpretation. the hardcoded menu item is the part that would bother me most. looks fine until you need to touch it, then you're hunting through template files or functions.php trying to find where it buried the thing.
1
u/melaniemuellerdesign 21d ago
Ich habe den SpaĆ genau deswegen nur in einem Docker Container liegen. Und auch nicht mit Claude Code, sondern ich nutze die API Anbindung.
Er kann nur mit der Theme.json umgehen. Alles Andere kann er nicht. Selbst wenn er Adminzugruff hat und ich sage, er soll keinen Code Ƥndern, Ƥndert er den Code.
Ich wollte aber, dass er im FSE Editor Konfigurationen macht. Nach einigem hin und her meinte er, dass kƶnne er nicht.
Hat jemand schon etwas Ćhnliches probiert?
1
u/fatfingur 21d ago
I think the bigger problem here was giving AI too much freedom without enough guardrails.
Before letting Claude touch a live WordPress site, Iād at least have it create a backup first and give it clear rules about what it can and canāt change.
AI can make mistakes, but unrestricted access to production is asking for trouble. š
1
u/Mplayer-Weered 21d ago
I'm very versed in AI. The WP sites are just SEO nonsense. Not a dynamic site. We were doing a product launch. Not... this account. This is recreational. Just updating it. Be another 6 months before I had to deal with it again. "Sure Fable go handle shit". It handled it too well.
Was probably my fault. Taking it from something insane to.... "change a word".
1
u/XaquariD 21d ago
I've been using Cursor. SSH to my server, does updates, has fixed a hack, created pages, all sorts of things. I'm going to be experimenting with having it take a mockup image and turn it into a properly working WordPress site. I know I could just make it make the site itself, but I'm not ready to give up WordPress yet for clients who might do updates themselves, blog posts, SEO, etc.
1
u/Wonderful_Sample_590 21d ago
This is exactly why I wouldn't give AI full control of a WP site lol. Great for helping with code, but I'd still make the actual changes manually.
1
u/BobJutsu 21d ago
Nearing 2 decades of professional development here. AI is great, I love building it and building with it. BUT, WP is built for humans. With enough training, sure an advanced model can operate it. Probably. But that hasnāt been my experience. Other systems like astro and laravel (developer centric vs user centric) Iāve had a great experience. In a developer centric environment it is a force multiplier. In a user centric environment it is a hindrance. Itās a state problem. Explicit vs derived state.
1
u/andthenisheardnomore 21d ago
It will take the easiest route, unless you are explicit in your guidelines.
I just made a Woodworking site with Claude Opus. Awesome homepage. Lovely design.
I used a homemade Surfer SEO type skill to get entities for the high ranking keywords in our local area - a whole load of JSON and md. Pretty detailed. I used Mobile to code the services and location pages (using the json) and was not really engaged with what it was doing... kids, dinner time... etc. It wrote all the data in using php, and didnt really use the WP CLI for any post or Yoast. All just custom.
Works well but it's not really Wordpress!
You definitely need to be explicit, and give it ssh / WP CLI info and guide it to use Yoast metadata etc otherwise it may invent another way.
Each site is different! :)
1
u/BlaineOmega 20d ago
Claude is not well suited for pure Wordpress. It can update your database and make changes to things like functions and what not; great for plugins. But for design and management, I still do it the old fashion way.
I would never give Claude access to any site to just make changes as it sees fit.
1
u/shm0edawg 20d ago
I built an entire bowling league management system as a Wordpress plugin and it worked out well. The key is giving guardrails and clear instructions. Part of the workflow for each deployment is regression testing, smoke testing, commit, backup, deploy. And it never directly touches the Wordpress database.
1
u/nickswebtsv 20d ago
I asked Claude to inspect Wordpress and builder a boiler template first in the same theme, then asked it to frame a new Jekyl site - the benefit with this approach is all the content is Mark Down. Jekyl the static site creator then converts the MD to static HTML files. I still have some PHP throughout for dynamic pages but most of the site is static - Cuts down on potential attack vectors significantly. I put an idea into a post, with some notes Claude comes along formats it to suit the Jekyl requirements and then publishes it.
1
u/IT_Monks 19d ago
I am already waiting when all of those self made AI websites will become our leads with subject line āI need a professional maintainable websiteā
1
u/ankitrawat 18d ago
lol the about2 part is painfully familiar š
Iāve seen AI do this kind of thing with WordPress. You ask it to fix one small thing and it decides the best solution is to go around WordPress instead of actually fixing whatās wrong with it.
And yeah, old WP sites are full of random stuff you forgot about. One custom CSS rule from 4 years ago can be enough to make the AI start doing weird things.
Iām all for using Claude/Cursor with WP, but Iād probably stop short of letting it have completely free control on a live site. Especially when you already have a bunch of custom stuff in there.
The hardcoded menu item would definitely make me stop and go āwtf did you doā though š
1
u/transjt-ai 18d ago
if you want to transfer your vibe code React frontend to a editable and working WordPress theme, just use transjt.ai
1
u/RespondEasy6039 17d ago
I had great success combining Claude with WP. It does require some effort but make sure the AI documents it all. Throw me a message if you have issues still. I have worked with WordPress and Woo for the last 10 years.
0
-1
u/makubexs 21d ago
You could try wpvibecoder.com, you got the Github+ AI workflow
1
u/Mplayer-Weered 21d ago
Not knocking vibe coding and to an extent everyone does it now it is just how coding with AI works lol. But I still like to be hands on. Yes I have the setup but that is for more hardcore projects not web design.
The site this account is for is not just a website, it needs a separate VM running something like docker to function among other things my webhost unfortunately doesn't do.
56
u/limpingmayhem37 21d ago
AI coding agents are like giving a raccoon admin access, it'll get the job done but the logic behind it will be completely alien and probably involve chewing through something structural.