Troubleshooting
WordPress Error Thrown: Causes and How to Fix It

Short answer
An error thrown message means PHP hit an uncaught error, stopped the page and named the file and line. Read the file path to find the plugin or theme at fault, then deactivate, update or reinstall it.
Key takeaways
- Thrown in marks the file and line where PHP stopped.
- The file path tells you which plugin or theme is at fault.
- PHP 8 upgrades often turn old warnings into thrown errors.
- Enable WP_DEBUG_LOG to capture the full message.
- Rename a plugin folder to disable it without the dashboard.
What does an error thrown message mean in WordPress?
An error thrown message in WordPress means PHP hit an uncaught error or exception in a plugin, theme or core file, stopped running, and reported the file and line where the problem was thrown.
You usually see it in a debug log or on screen as a long message. It looks something like this:
PHP Fatal error: Uncaught Error: Call to undefined function example_function()
in /home/site/public_html/wp-content/plugins/example-plugin/example.php:42
Stack trace:
#0 /home/site/public_html/wp-includes/class-wp-hook.php(324): example_callback('')
#1 {main}
thrown in /home/site/public_html/wp-content/plugins/example-plugin/example.php on line 42
The words thrown in come at the end. PHP uses throw to raise errors and exceptions, and when nothing catches them, it stops the page. PHP's manual on errors in PHP 7 and later explains how this works.
On a live site, visitors usually see There has been a critical error on this website instead of the full text. Our guide on fixing the critical error message covers that screen.
PHP's own error handling reference in the official manual explains how thrown errors and exceptions differ from older warnings.
How do you read an error thrown message?
Read three parts: the error type after Uncaught, the message that follows it, and the file path, which tells you which plugin or theme caused the problem.
| Part | Example | What it tells you |
|---|---|---|
| Error type | Uncaught Error, Uncaught TypeError | The category of problem |
| Message | Call to undefined function | What went wrong |
| File path | /wp-content/plugins/example-plugin/ | Which plugin, theme or core file |
| Line number | on line 42 | Where in the file |
| Stack trace | #0, #1, #2 | The chain of calls that led there |
The file path matters most for site owners. Look for one of these folders:
- /wp-content/plugins/name/ points to a plugin
- /wp-content/themes/name/ points to a theme
- /wp-content/mu-plugins/ points to a must-use plugin, often added by your host
- /wp-includes/ or /wp-admin/ points to WordPress core, though the real cause is often a plugin further up the stack trace
If the top file is core, read down the stack trace. The first line that mentions a plugin or theme folder is usually the culprit.
What are the most common error thrown messages?
The most common ones are calls to undefined functions, calls on null values, type errors after a PHP upgrade, missing classes, and wrong argument counts.
| Message | Common cause | Usual fix |
|---|---|---|
| Call to undefined function | Missing plugin, add-on or PHP extension | Install the required plugin or ask host to enable the extension |
| Call to a member function on null | Code expected an object that was not there | Update the plugin or theme |
| Uncaught TypeError | Code written for older PHP | Update the plugin or roll back PHP |
| Class not found | Missing dependency or broken update | Reinstall the plugin |
| ArgumentCountError | Plugin and its add-on are out of step | Update both to matching versions |
| Uncaught Exception | Code raised an exception nobody caught | Check the message and contact the developer |
Add-ons are a frequent source. If you deactivate a main plugin but leave its add-on active, the add-on may call functions that no longer exist.
Missing PHP extensions cause errors too. If the message names a function such as mb_strlen or imagecreatefromwebp, the plugin needs a PHP extension your server does not have. Your host can usually turn it on from the PHP settings page.
Why do these errors appear after a PHP upgrade?
Newer PHP versions are stricter, so code that only gave warnings on older PHP can throw fatal TypeError or ValueError errors on PHP 8 and later.
For example, older code might pass a string where a number is expected, or count something that is not a list. PHP 8 stops on these instead of guessing.
If errors start right after your host upgraded PHP:
- Update every plugin and theme first, since many fixes are already out.
- If the site is still down, switch back to the previous PHP version in your hosting panel as a short-term fix.
- Contact the plugin or theme developer with the error text.
- Replace plugins that are no longer maintained.
Our guide on whether WordPress works with PHP 8.5 covers compatibility for the newest release.
How do you find the full error message?
Turn on WordPress debug logging in wp-config.php, reload the broken page, and open wp-content/debug.log, or check the recovery mode email WordPress sends to the admin address.
Add these lines above the line that says to stop editing:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
This saves errors to a log without showing them to visitors. The official debugging guide explains each setting.
Our guide on reading the WordPress debug log shows how to spot the useful lines among the noise.
WordPress also emails the site admin when a fatal error happens. The email includes the error and a recovery link. Our article on WordPress recovery mode explains how to use it.
Turn WP_DEBUG off again once you have fixed the problem.
Your host also keeps a PHP error log. It records fatal errors even when WordPress debugging is off, so it is worth checking if debug.log stays empty. Look for it in your hosting panel under logs or metrics.
How do you fix an error thrown by a plugin?
Deactivate the plugin named in the file path, then update, reinstall or replace it, and check whether it needs another plugin or a newer PHP version.
If you can reach the dashboard through recovery mode:
- Go to Plugins.
- Deactivate the plugin named in the error.
- Check the site works.
- Update the plugin, or reinstall a fresh copy.
- Turn it back on and test.
If you cannot reach the dashboard, rename the plugin's folder in wp-content/plugins using FTP or your host's file manager. WordPress deactivates it automatically. Our guide on deactivating plugins without admin access shows every method.
If an update caused the error, roll back to the previous version. A tool such as WP Rollback can install older versions of plugins from the directory.
How do you fix an error thrown by a theme?
Switch to a default theme, then update or reinstall your theme, and check any custom code added to its functions.php file.
Custom snippets are a common cause. A missing semicolon or a function that already exists elsewhere can stop the whole site.
If you cannot reach the dashboard, rename the active theme's folder in wp-content/themes. WordPress falls back to a default theme if one is installed.
Then:
- Undo the last code change you made
- Move custom code into a child theme or a code snippets plugin
- Update the parent theme if you use a child theme
- Check the line number in the error, then look at that line in the file
What about JavaScript errors that say uncaught?
Errors like Uncaught TypeError in your browser console come from JavaScript, not PHP, and they break things like the block editor, sliders or checkout buttons rather than the whole site.
You find these in the browser's developer tools under the Console tab. The file path again names the plugin or theme. MDN keeps a list of JavaScript error messages with explanations.
The fix process is the same: find the plugin, update or disable it, and clear caches. Our guide on fixing a plugin conflict walks through it.
How do you stop these errors from coming back?
Keep plugins, themes and PHP up to date, test updates on a staging site first, remove abandoned plugins, and keep a recent backup you can restore quickly.
A short prevention list:
- Update plugins one at a time on important sites
- Use a staging site for major updates
- Check plugin requirements before upgrading PHP
- Keep add-ons and their main plugins on matching versions
- Use the Health Check and Troubleshooting plugin to test changes safely
For a deeper look at why fatal errors happen, see what causes the critical error message.
Frequently asked questions
Is an error thrown message the same as a critical error?
They are usually the same problem seen in two places. Visitors see the critical error screen, while the log or recovery email shows the full error thrown message with the file and line. Fix the cause named in the log and both go away.
Can I ignore an error thrown in the debug log?
Not if it is a fatal error, because the page stopped loading at that point. Some log lines are only warnings or notices, which are less urgent. Look for the words Fatal error or Uncaught to find the ones that need fixing.
Why did the error start without me changing anything?
Automatic updates, a host PHP upgrade or an expired licence can trigger errors without any action from you. Check your host's PHP version history and the plugin update dates around the time the error started.
Will switching PHP versions fix the error?
Going back to the previous PHP version often brings the site back if the error started after an upgrade. Treat it as a short-term fix, since older PHP versions stop getting security updates. Update or replace the plugin that failed.
Should I send the full error to the plugin developer?
Yes, the full message and stack trace help developers find the bug quickly. Remove anything private first, such as database names or usernames in file paths, and include your WordPress, PHP and plugin version numbers.
Sources
- Debugging in WordPress WordPress Developer Resources
- JavaScript error reference MDN Web Docs
- Health Check and Troubleshooting WordPress.org Plugins
- WP Rollback WordPress.org Plugins
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
Related guides
About the editors
Researched from the primary sources listed above and checked against our editorial rules before publishing.


