How to Use ChatGPT to Debug WordPress Errors on Shared Hosting

Writer: Dave McQuilling

Dave McQuilling, Technology Journalist

Dave McQuilling is a technology journalist with nearly two decades of experience and bylines in Forbes Vetted, SlashGear, Digital Trends, HowToGeek, and more. He specializes in hands-on reviews of web hosting and digital services for HostingAdvice.com, helping readers make informed, practical tech decisions.

Close

Editor: Britain Simons

Britain Simons, Marketing Editor

Britain Simons is a Marketing Editor for HostingAdvice, with a passion for editing and delivering high-quality, easy-to-understand articles on complex topics. He brings a decade of experience in TV/Film and viral content strategy to craft high-impact narratives that scale reach. With a sharp editorial instinct and deep understanding of audience behavior, Britain knows how to translate technical information into engaging content that performs across platforms.

Reviewer: Cristian Lopez

Cristian Lopez, News Manager

Cristian Lopez uses his Business Marketing background from the University of Illinois at Chicago to create comfortable environments for customers, clients, and colleagues to share their thoughts and ideas openly. From interviewing tech leaders to conducting UX market research projects, Cristian knows the importance of storytelling — a key variable for innovation and inspiration. His goal at HostingAdvice is to wow readers on the ever-evolving nature of the tech industry and bring his audience the most reliable and exciting content on all things hosting.

Our experts take readers step-by-step through a variety of hosting and programming tasks in our popular series of how-to guides.
Follow Us:
2.7k
16k
5.7k
134
3.5k

AI has gotten pretty good in the last few years — you can even use it to debug WordPress errors. But, it isn’t that good. You can’t just say “fix my site” and expect it to work. There’s a bit of a process you should follow if you want to avoid destroying your site and actually see decent results.

Beyond that, there are some glaring problems ChatGPT is pretty useless at fixing. Especially a few where you’re better off just fixing things the old-fashioned way. Which, let’s be honest, is either “googling it” or just hitting up your hosting provider’s customer service department.

I used ChatGPT Pro while researching this article, and you should too. While you do get some limited use of ChatGPT (for free), Pro gives you access to more powerful models. It’s also worth noting that while we used ChatGPT, this guide should also apply to Gemini, Claude, Grok, Perplexity, or whichever alternative AI you want to use.

Step 1: Identify the Exact WordPress Error Before Asking ChatGPT Anything

I know what you’re thinking. “Why are you asking me to identify the error? If I knew what the problem was, I wouldn’t need ChatGPT.”

Well, technically, that’s only half the battle. When it comes to using AI effectively, vagueness is not your friend. This is something I have not only experienced while using AI to troubleshoot WordPress issues, but also something that applies to basically anything you use AI for.

There are plenty of reasons a WordPress site won’t work, and if you don’t narrow it down, the AI is going to ask you to explain the problem anyway. Good communication makes for a healthy relationship.

While your WordPress error may be very specific, there are a few basic error categories that are easy to spot.

Example – The White Screen of Death:

If the screen is just blank white, you have the “white screen of death.” Other errors like the “500 internal server error” or text saying “there has been a critical error on this website,” are providing you with information you should be passing on to ChatGPT. To solve your problem quickly, provide as much information as you can.

A good prompt might sound something like:

“My WordPress site is not working. It’s just a blank white screen. Right before the error, I installed two plugins (we’re not going to pick on anyone, but name the plugins).”

That’s enough information for ChatGPT.

You should also mention anything that will make a fix harder to implement. If your admin area isn’t working, or you can’t login, there’s a priority stack you’ll have to fix first.

If you aren’t the most technical person in the world, don’t worry. Use ChatGPT to help you narrow down the error. You should still provide as much context as you can, and screenshots can really help here, as you’ll see later on.

If you really want to give ChatGPT the info it needs to help you, make note of error codes and debug information. To get that, you’ll need to enable debug mode.

WordPress Debug Tool: A super helpful developer tool that will display PHP errors, any warnings, and notices that are usually hidden. Thankfully, it’s built toward WordPress.

Step 2: Enable WordPress Debug Mode On Shared Hosting

Shared hosting is good for many things. It’s great if you want to save money, ideal if you have a smaller site, and not a lot of trouble. It’s perfect if you aren’t the best at the more technical side of things. But it does have its limitations.

WordPress will handle security and maintenance, which is good. But that means limited configuration control, and you won’t have root access. As the name suggests, you’re sharing that server with a whole bunch of other people. That’s why it’s so cheap. So, you can’t go tinkering with it.

So now is the time to enable WordPress’s own debugging tool. This is specific to your site and will give you the error details you need going forward.

If you’re using ChatGPT because you find all of the coding and files a bit intimidating, this part may have you on edge. But don’t worry, it’s actually quite simple.

Enter cPanel on WordPress to manage your website. Once you get into the control panel, you should look for the “WordPress Management” section.

The particular version of cPanel I was using had a “debugging” toggle under “Tools.” Selecting that toggle puts WordPress into debug mode. It’s that simple.

No luck? If you’re using a different version of cPanel or a completely different control panel altogether, follow these steps:

Look for “File Manager” or something similar. You can also access your WordPress site’s files through “SFTP Access” or “FTP Access” if that’s what your particular shared hosting provider offers. If you’re still a little stuck, their customer service should be able to guide you through, and we’ll continue where we left off.

Once you have accessed your site’s files, you need to look for wp-config.php.

It tends to be in the site’s root directory, which is a folder called public_html.

When you find the file you need to right-click it and select edit.

From there, scroll down until you find a line with the words WP_DEBUG and false on it (debug disabled). Change false to true (make sure it’s lower case), and you’ve just put your site into debug mode.

Important: Make sure you click save afterwards. If you just close the page, it’ll revert to false.

While you can set it so errors show up in the HTML page’s console when you hit F12, enabling the debug.log file is also a good idea.

Using the debug.log file creates a permanent (until deleted) record of errors your site encounters. The benefit is that you can check at any time. The errors on the HTML page may just vanish when the page closes, which means wasted time to work out what triggered the error again.

The easiest way to enable the debug.log file is to click the options button near the debug toggle in cPanel’s WordPress manager, then select “Enable the main debug mode in WordPress” > “show debug” and save.

You can access the debug.log file from the file manager, right next to where you found the WP_config file. The details in that log will allow you to give ChatGPT a far better idea of what the problem is.

Step 3: Use ChatGPT to Interpret PHP Error Messages Clearly

The point about providing as much info as possible still stands, but with more common errors, you can simply relay the error code. ChatGPT will walk you through the troubleshooting phase if it needs more information. For example, I told ChatGPT my site was giving me a “memory exhausted error,” and the site was broken.

The LLM (Large Language Model) immediately explained what the error was and outlined various causes, including my host’s PHP memory limit being set too low, plugin issues, and an update causing problems.

It then went on to explain how the full error line could help point me in the right direction, before providing some basic fixes for many of the issues it flagged. The bot did a similar thing when I prompted it about parse errors and fatal errors.

A parse error is like a typo in the sentence, aka a syntax error. It’s broken code that WordPress can’t read, such as a missing semicolon.

A fatal error is more critical — the code is running, but something is broken, like a gearbox that rattles. It could be a conflicting plugin, PHP memory, or something else.

I then asked ChatGPT how I could find the exact error line, and it gave me a variety of instructions that could apply to a wide range of hosts and control panels.

Here’s a timesaving hack: If you aren’t too technical, and giving the code a blank stare, just screenshot it. Upload your screenshots as an image to ChatGPT.This doesn’t just apply to this step — it applies to every troubleshooting issue.

A screenshot provides the context it needs to give you specific instructions. In this case, it pointed out exactly what I needed to click (to see full error messages). Those error messages can then be fed into the LLM, our chatbot, to give further context and get to the root of the issue.

Step 4: Debugging Plugin Conflicts On Shared Hosting

Plugins on WordPress are a bit of a double-edged sword. On the one hand, they take seconds to install and can add a massive amount of functionality to your site. The alternative would involve spending hours coding something yourself (that may not be as good).

On the flipside, plugins are known to cause a lot of errors. If something goes wrong with your site, the plugins tab should be one of the first places you look. If your site is working fine, plugin conflicts will only really occur after an update or when you install a new plugin.

If it’s the former, you may get lucky and have an error code point you straight toward the affected plugin. Use ChatGPT to correct that error code. If you’re unlucky, you’re going to struggle to deduce the cause without a bit of brute force, and ChatGPT will likely tell you the same thing.

Standard procedure when a PHP or WordPress update causes problems is to disable all of your plugins, then add them back in one at a time.

This allows you to single out the ones that are broken, and it takes time. But if you don’t want your site to stay down for too long, it’s likely quicker than waiting for someone else to work out which plugins are broken.

Then there are times when individual plugins receive updates, which can lead to conflicts with other plugins, your firewall, or theme. There’s a reason auto-update tends to be off by default in many WordPress plugin managers.

If you install a bunch of plugins at the same time, which is an absolutely terrible idea, ChatGPT can scan your entire list of plugins and will flag any known conflicts. This is pretty handy, but only really works with established problems people have posted about.

Step 5: Fixing Theme Errors and functions.php Mistakes

If you want to customize your WordPress site and don’t mind getting your hands dirty, then you’ll likely be spending a lot of time in the Theme Editor. Unfortunately, ChatGPT gets a little bit confused.

If you use WordPress a lot, you’ll know how much it’s changed in the past year or so. The Block Editor was introduced, and with it, everything in the back end seemed to move around a bit.

It’s part of a fun game software companies play where they’ll take a function or tool everyone has happily used for 20 years, change its name, and dump it in a random menu so you’ll never be able to find it. Adobe is also a massive fan of this.

There’s a lot of debate about AI rights and digital personhood, and I can confirm ChatGPT is just as confused as any real person. It doesn’t have a clue where anything is with the WordPress changes.

At the time of writing this, ChatGPT’s instructions all refer to the old WordPress, even if you point out that things are different. Screenshots are again handy, and it will make an educated guess about where something is.

I had to make my own way (via the old editor) to functions.php, as it isn’t really accessible through the block theme. Then I deliberately, but subtly, messed up the code and copy-pasted the entire functions.php file into ChatGPT while asking why I had a theme error.

ChatGPT spotted the syntax error I deliberately caused in a second. This is what the LLM actually excels at. It wasn’t the hardest error to spot, but it would have still taken a fair bit of careful reading before I personally would have discovered that issue.

The only problem is, LLMs don’t really see things like we do, so they can’t give me a line number. It’s not a big deal, Ctrl+F (find) and entering the particular typo ChatGPT flagged brought me straight to the error. But it is something you should be aware of. If ChatGPT gives you a line number, there’s a chance it’s a lie.

Step 6: Resolving 500 Internal Server Errors On Shared Hosting

500 errors can have a few causes. In this case, it was me sabotaging things again. I decided to delete a pretty vital semicolon in the wp-admin file. I wasn’t going to hand ChatGPT this one on a plate either. I’d mention I had a 500 error, show them a screenshot of the core directory, and let it take things from there.

It requested more info from the error log, but also made an educated guess from the screenshot I included, which had an impressive level of detail. It spotted that wp-admin was modified recently, and my theme had also been altered.

I copied the error log over. The cause of the 500 error had not been logged at that point. ChatGPT did spot some earlier plugin issues and suggested they could be the cause. So be aware that false positives could happen. It’s all part of the troubleshooting process.

As soon as the 500 error showed up, ChatGPT pretty much guessed exactly what it was. A syntax error, likely a missing brace. It did not flag the exact file the error was in, because the error log doesn’t provide that much information.

If you’re in this situation, I would suggest providing all of those files until you get a hit. I copied over the (unaltered) functions.php file again, and ChatGPT cleared it. When I copied over wp-config, it again spotted the syntax error immediately.

While this was specifically about a 500 error, it could be applied to a lot of troubleshooting involving AI. It can’t do all the work, but you can work together with it to get to the bottom of a problem. Even if that problem is a missing brace somewhere in an entire WordPress site’s codebase.

The takeaway here – give ChatGPT as much information as possible to remove the guesswork: screenshots, error logs, and relevant information.

Step 7: Fixing the WordPress White Screen of Death

If a fatal error prevents your WordPress site from loading, you’ll encounter the infamous white screen of death (WSoD).

The white screen itself is by design. WordPress puts it in place to prevent any security vulnerabilities that are created by a fatal error from being exploited. If it displayed an error message instead, a bad actor may be able to use that in a negative way to exploit site vulnerabilities.

With that being said, we’re going to need to get rid of that white screen to fix the error, so it’s best to do the troubleshooting in some kind of sandbox environment, and not on the live site.

The exact fatal error that results in the WSoD can be caused by a few things. The culprit is usually a plugin conflict, a theme error, or memory exhaustion. To find out exactly what the issue is, you’ll need to enable debug mode (which is explained in Step 2).

Once debug mode is enabled, the white screen should be replaced with the error code you need. Make note of this process for future debugging.

Feed that error code into ChatGPT. The LLM should be able to walk you through fixing the problem.

Note: It may also be a good idea to make a reference document listing plugins, updates, themes, hosting, and CMS (Content Management System). If the problem is plugin-related, and you feed the LLM a list of your plugins (including the exact version and which WordPress version you’re using), it might be able to quickly flag any known conflicts.

Step 8: Handle Database Connection

If you see the words “Error Establishing a Database Connection,” then that usually means your wp-config (the same one you may have accessed to enable Debug mode), or another core file, is messed up. It could also be a plugin error, because plugins like to ruin your day.

Unfortunately, this is one of the areas where ChatGPT can’t really help you. In fact, following its advice might actually make things a lot worse. In a “best case” scenario, ChatGPT will give you the same advice that I’m about to.

Before assuming database corruption and embarking on a full WordPress re-install, try these prompts for ChatGPT to check if you’re undertaking the correct course of action:

  1. Check your database credentials: it could be a mismatch between wp-config.php and your database name, password, or username for your host. ChatGPT will not be able to give you these credentials. That’s something you’ll have to ask your service provider for. But you can ask ChatGPT what credentials to ask for, or have the LLM flag any that are missing, by copying over your wp-config.php file.
  2. Use the WordPress Database repair tool: add define(‘WP_ALLOW_REPAIR’, TRUE); to the wp.config.php file and type the URL [your site].com/wp-admin/maint/repair.php to narrow down the issue. Remember to remove this line once the fix is complete.
  3. Check table corrupt files in phpMyAdmin: from your cPanel > WordPress database > run Check Table command to see if any are corrupted.

This will essentially fix all of your problems, assuming that it has been caused by database corruption, not a rogue plugin. You should always rule out plugin-related issues before pushing ahead with a database reinstall.

To reinstall a fresh copy of WordPress, look for wp-admin and wp-includes folders and delete them (keep wp-content and wp-config.php). Then replace the deleted files with copies from a clean WordPress package. If you’re using cPanel, there is a tool that handles WordPress re-installs for you.

A slightly less extreme variant involves just using whatever tools your hosting provider has to check and repair your WordPress core files, like the repair tool above. As this only replaces damaged core files, it’s not going to mess up your site, and the verification step will let you know if anything was wrong with the database in the first place.

After reinstalling WordPress’ core files, a Database Connection problem that persists is more than likely going to be one of two things. It’s the credentials in the wp-config file, or those plugins that you should have ruled out before embarking on this step.

Again, ChatGPT can’t help you with site-specific names and credentials. It doesn’t know what your credentials are, and it’s about as likely to guess a random string of characters correctly as that moldy french fry under your passenger seat, from that McDonald’s you spilled last year.

But your hosting service’s customer service can definitely help you resolve this. Get in touch, have them furnish you with your credentials, and check that they match those listed in the wp-config file.

A missing character, or even something in the wrong case, can just break everything here. If that’s all gucci, then you’re going to spend some time disabling plugins until you catch the little nugget that’s messing up your site.

Step 9: Debugging After a WordPress or PHP Version Update

WordPress and PHP updates are both vital for many reasons, but mostly for security. Stay on top of current versions. A good chunk of the time, an update isn’t being pushed so you can play with a fancy new feature; it’s there to patch those security vulnerabilities, so definitely install any WordPress or PHP updates you spot as soon as you can.

The downside of WordPress updates is the fact that they can break things. There are a lot of puzzle pieces that need to fit together: software, databases, themes, and plugins. They’re all meant to work with specific versions of one another.

Older plugins in particular are built for a particular version of WordPress, but every single update changes things behind the scenes and can break compatibility. I know I’ve spent this entire piece pointing out why ChatGPT might struggle with troubleshooting problems like this, and that’s going to continue. But, there’s hope.

The core database LLMs like ChatGPT are trained on is going to be at least six months old, with some information in it being even older. That means it isn’t going to have the slightest clue about a WordPress or PHP update that dropped a few hours ago.

However, unlike older versions, ChatGPT now has access to the internet. So you can have it essentially scrape through forums and sites looking for plugin incompatibilities that other users have flagged.

Technically you could cut out the middle man (or bot) and just search “PHP 8.whatever plugin incompatible” or something. But there is a chance that ChatGPT would be better at finding something you would miss, consolidating multiple sources, and saving you time. It may also be able to break down the troubleshooting process in simpler terms than a coding forum. Use a prompt like this:

Scrape the most popular website forums, Reddit posts, and coding resources to find the most current information regarding the [today’s date] version of WordPress, to resolve [this] PHP error. Build a step-by-step guide to test and fully resolve that error.

Step 10: Creating a Repeatable ChatGPT Debugging Framework

Hopefully you found everything written above thrilling, and you now thoroughly understand how to debug your site with ChatGPT. But just in case something slipped through, or if you just scrolled to the bottom for some reason, let’s recap.

The first thing you should do is identify the exact error.

Good old-fashioned Google is your friend here, as you can generally type what you see into the search engine, and your exact problem will show up. Then, take the information to ChatGPT to break it down, create troubleshooting steps, or analyze the error code info against your data, screenshots, and site versions.

The internet is vast, WordPress is popular, and plenty of people have been in the same spot you are. Knowing roughly what the problem is gives the LLM an opportunity to focus, assess all data, and reduce the odds of it hallucinating — just making something up.

This is where ChatGPT comes in handy, but it will need a little more info first. Remember, the more information you feed it, the lower the odds of a hallucination. And the lower the odds of you making things worse with an attempted fix.

So, enable debug mode either in cPanel (control panel) or in WordPress’s file manager.

When you’ve enabled debugging, you should be able to pull an exact error code. Copy the entire code and feed that into ChatGPT. From there, the LLM should be able to work out what the issue is and point you in the right direction.

Now, the fix might make things worse. AI makes mistakes. So applying it to a live site is risky. You can use a local setup like Local by Flywheel or XAMPP to test out the fix in a sandbox. Some shared hosting services also provide a staging environment you can test things out on.

If the fix works in the sandbox, you’re ready to try it on the real site. If it breaks the site in the sandbox, you can go back to the drawing board. If you’re unsure, keep adding context and asking questions until you’ve found the exact cause of your problem. If multiple fixes are proposed, make sure you try one at a time.

Important Note: Once you’ve applied the fix, it’s probably worth clearing all of your caches, including the server-level caches and the one in your browser. Cached data can sometimes make it seem like the error is still there.

You should definitely keep a record of working solutions. The chat you had with the GPT can double as an archive of the entire process. I’d recommend starting a new chat for each problem you need to troubleshoot.

However, there is a trick to carry the best results of your previous conversations forward.

ChatGPT allows you to create “custom GPTs.”

These are basically parameters you can add to the base model to make it better at performing a particular task. If an instruction you provided helped ChatGPT get the job done, or at least prevented it from making a mistake, you can add that to a custom GPT.

Then, using that custom GPT next time you’re troubleshooting should save you from having to essentially retrain the AI to do the job properly. No need to start at zero every time.

Troubleshoot: Common Mistakes When Using ChatGPT to Fix WordPress Errors

A mistake you may make with ChatGPT is model selection. It’s easy to do if you don’t click the drop-down menu in the top corner. You may be using a less powerful version of ChatGPT than you paid for.

Don’t forget, if you have access to ChatGPT Plus, you should select “Thinking” whenever possible. Your use of the “Thinking” model is limited, even with a Plus subscription, but your outcome will be far better than with the “Instant” model. ChatGPT spends more time checking its work here, so more mistakes are eliminated along the way.

“Auto” is the default, but it may use “instant” more than you’d like it to. ChatGPT suggests it uses the best model for the situation, but the Instant model uses far fewer resources. So it’s likely to err on the side of the cheaper, less powerful option.

Other problems include pasting incomplete errors, which will leave ChatGPT guessing. If you blindly copy and paste the AI’s code into your WordPress, you’ll have a difficult time identifying any further mistakes. So ask ChatGPT what the changes are, and make sure those are the only changes.

Comments: Be aware of changes by also asking for comments, aka notes, that will be ignored by the web browser, but help you learn what the code does.

Post the changes one at a time, too. A little extra time with incremental updates makes troubleshooting very easy. As opposed to crashing your site with no clue which of your changes caused it.

Oh! And make sure you back up your site without changing a thing. Grappling with an LLM AI can be frustrating, but it’s worse when ChatGPT is being difficult and your whole site is ruined as a result. Think of it like creating save states in a game. Use plugins like UpdraftPlus or BackupBuddy. It’s more efficient than using phpMyAdmin to export the database.

Mistakes will happen with any current AI. But if you structure things properly and carefully implement any changes, you should be able to streamline your fix and reduce the odds of anything going wrong.

Turning Shared Hosting Limitations Into a Structured Debugging Advantage

So there you have it, fixing WordPress errors doesn’t have to be that complicated, but it can be tedious. You have a step-by-step process that should help you to get to the bottom of most errors. Some of them, like those caused by a recent change to your site, may not even need ChatGPT’s help to fix if you stay on top of updates and database configuration.

While a shared hosting site can be quite limiting, your WordPress backend is still your own. So, taking advantage of things like cPanel, plugins, and WordPress’s own tools to debug your site can help turn something as blank as a plain white screen into a source of vital info. ChatGPT can help you get familiar with those tools.

Last, you now know what information to compile to really unleash the power of your LLM through data-driven, error code, site-specific, and relevant prompting. Avoid hallucinating results and always be sure to test the fix in a sandbox — or at the very least have site backups ready to reinstall.

I’m going to end on this, because it can’t be said enough. Double-check everything ChatGPT is telling you to do, and again, back up your site before you do anything. There’s no such thing as too many backups.

If you’re not yet, be sure to give us a follow on social media. You can also use the handy search bar to get expert advice on anything else website-related you may be working on.

About the Author

Dave McQuilling
Technology Journalist

Dave McQuilling is a veteran journalist with nearly two decades of experience covering technology, digital services, and consumer innovation. He has contributed reviews and analysis to publications including Forbes Vetted, SlashGear, Digital Trends, HowToGeek, ReviewGeek, and The Manual. At HostingAdvice.com, Dave focuses on hands-on web hosting and infrastructure reviews, testing providers for performance, reliability, and usability. He combines real-world experimentation with clear and entertaining explanations to help readers make informed decisions.

« BACK TO: HOW-TO

Meet the Experts

Our team of experts with a combined 50+ years of experience in web hosting serve insight and advice to more than 20 million users!

We Know Hosting

$

4

8

,

2

8

3

spent annually on web hosting!