On this page
Asking ChatGPT for a WordPress snippet is fast and often works. It is also how a lot of sites end up with a white screen, a plugin conflict or a form anyone can abuse. Here is a short routine before you paste anything.
1. Make a backup
Use your host’s backup tool or a backup plugin. If something goes wrong, you can roll back in minutes instead of hours.
2. Do not paste into functions.php
One mistake there can take down the whole site, and theme updates can wipe your change. Use a snippets plugin or a small custom plugin instead. If it is too late, here is how to recover from a functions.php crash.
3. Ask what it does, line by line
Ask the AI to explain the code in plain words. If the explanation includes things you did not ask for, remove them.
4. Check for the basic safety pieces
Anything that saves data or uses form input needs a few checks. Look for these words in the code:
wp_verify_nonceorcheck_admin_refererfor formscurrent_user_canfor permissionssanitize_functions for input andesc_functions for output$wpdb->preparefor database queries
If they are missing, the code is not ready. Our guide on AI plugin security holes shows what each one looks like.
5. Test on a copy first
Many hosts offer a one-click staging site. Test there, then copy the change to the live site.
When to get a second pair of eyes
If the code touches payments, user accounts or personal data, have a developer check it before it goes live. An AI code review is quick and costs far less than a cleanup after something goes wrong.
Built by AI?
Fixed by hand.
If your project has the problem this post describes, a specialist can look at it and send a fixed estimate.
Request a repair crewKeep reading
How to brief a developer when your app was built with AI
A good brief gets you a faster, cheaper and more accurate estimate. Here is exactly what to send, even if you do not know the technical words.
Should you fix your AI-built app or start over?
Starting over feels clean. Fixing feels cheaper. The right answer depends on a few things you can check yourself.