A WordPress user recently reported that a plugin worked correctly until the website was upgraded to WordPress 7. After the upgrade, activating or using the plugin caused a PHP fatal error. In some cases, the entire website crashed. In others, only form submissions stopped working.
This type of problem does not necessarily mean that WordPress 7 itself is broken.
A major WordPress update can expose outdated code inside a plugin, theme, custom snippet, or integration. The plugin may be calling a function incorrectly, loading a class too early, depending on an unsupported PHP version, or failing when WordPress processes an AJAX or REST API request.
WordPress 7.0 was officially released on May 20, 2026. WordPress 7.0.2 was released on July 17, 2026 as a security update, so permanently downgrading to an older WordPress version is not the safest solution.
The correct approach is to recover the site, identify the exact error, isolate the incompatible component, and then update or patch it.
Quick Solution
To fix a fatal error after upgrading to WordPress 7:
- Create a full backup.
- Deactivate the affected plugin.
- Enable the WordPress debug log.
- reproduce the error.
- Inspect the file path and line number in
debug.log. - Update the plugin, theme, and PHP version.
- Test for plugin conflicts.
- Patch or replace the incompatible plugin.
- Test the solution on staging.
- Keep WordPress updated after the issue is resolved.
Do not start by randomly editing WordPress core files. The fatal-error message normally tells you exactly which plugin, theme, or custom file caused the crash.
Step 1: Back Up the Website
Before changing plugins, PHP versions, or WordPress files, create a complete backup containing:
- The WordPress database
- The
wp-contentdirectory - Themes and plugins
- Uploaded media
- The
wp-config.phpfile - Server configuration files such as
.htaccess
When possible, create a staging copy and perform the troubleshooting there first.
If the website is already inaccessible, download the files through FTP, SFTP, SSH, or the hosting File Manager. Export the database through the hosting panel or phpMyAdmin.
Step 2: Deactivate the Plugin Causing the Fatal Error
If you can access the WordPress dashboard, go to:
Plugins > Installed Plugins
Deactivate the plugin that stopped working after the WordPress 7 update.
If you cannot access the dashboard, use one of the following methods.
Method 1: Use WordPress Recovery Mode
WordPress may send an email to the site administrator with a subject similar to:
Your Site is Experiencing a Technical Issue
Open the recovery link in the email. WordPress Recovery Mode temporarily pauses the component responsible for the fatal error and allows you to log in.
Once logged in:
- Open the Plugins page.
- Find the paused plugin.
- Deactivate it.
- Update it or investigate the error before reactivating it.
Method 2: Rename the Plugin Folder
Connect to the server and open:
/wp-content/plugins/
Find the affected plugin directory. For example:
/wp-content/plugins/example-plugin/
Rename it to:
/wp-content/plugins/example-plugin-disabled/
WordPress will no longer be able to load the plugin and will deactivate it automatically.
WordPress documentation specifically recommends renaming a plugin folder when a fatal error prevents access to the dashboard.
Method 3: Use WP-CLI
Users with SSH access can deactivate the plugin with:
wp plugin deactivate example-plugin
To deactivate all regular plugins temporarily:
wp plugin deactivate --all
To deactivate all plugins except selected essential plugins:
wp plugin deactivate --all --exclude=woocommerce,wordfence
WP-CLI officially supports deactivating one plugin, multiple plugins, or all plugins from the command line.
Step 3: Enable WordPress Debug Logging
A message such as “There has been a critical error on this website” does not provide enough information to fix the problem.
You need the complete PHP error.
Open wp-config.php and add the following code above the line that says:
/* That's all, stop editing! Happy publishing. */
Add:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
Save the file and reproduce the problem.
For example:
- Activate the plugin again.
- Submit the affected form.
- Open the page that crashes.
- Repeat the action that triggers the error.
Then inspect:
/wp-content/debug.log
The newest entry should contain information similar to:
PHP Fatal error: Uncaught TypeError ...
in /wp-content/plugins/example-plugin/includes/form-handler.php
on line 245
The most important parts are:
- The error type
- The error message
- The plugin or theme path
- The PHP filename
- The line number
- The stack trace
WordPress recommends using WP_DEBUG_LOG to save errors to the debug log rather than displaying sensitive error details publicly.
After troubleshooting, disable debugging:
define( 'WP_DEBUG', false );
define( 'WP_DEBUG_LOG', false );
define( 'WP_DEBUG_DISPLAY', false );
Do not leave public error display enabled on a production website.
Step 4: Understand the Fatal-Error Message
Here are some common fatal errors that may appear after a WordPress update.
Call to Undefined Function
Example:
Uncaught Error: Call to undefined function plugin_example_function()
This usually means:
- A required plugin file was not loaded.
- The plugin depends on another plugin.
- The function was renamed or removed.
- The plugin is loading its code in the wrong order.
- A conditional include failed.
The full path in the log will show which plugin attempted to call the missing function.
Class Not Found
Example:
Uncaught Error: Class "Example_Plugin_Handler" not found
Possible causes include:
- An autoloader did not run.
- A required file is missing.
- The plugin dependency is inactive.
- The class is instantiated before the plugin finishes loading.
- The plugin contains an incompatible Composer dependency.
TypeError
Example:
Uncaught TypeError: count(): Argument #1 must be of type Countable|array, null given
This indicates that the plugin passed an incorrect value type to a PHP function or method.
The plugin may expect an array but receive:
nullfalse- A string
- A
WP_Errorobject - An incomplete API response
The code must validate the value before using it.
A developer might change code like:
$total = count( $items );
To:
$items = is_array( $items ) ? $items : array();
$total = count( $items );
The correct patch depends on what $items is supposed to contain. Do not apply generic code without checking the surrounding function.
ArgumentCountError
Example:
Too few arguments to function example_callback()
This commonly happens when a callback is registered incorrectly.
For example:
add_action( 'save_post', 'example_callback' );
But the callback expects three arguments:
function example_callback( $post_id, $post, $update ) {
// Plugin logic.
}
The hook registration should declare how many arguments the callback accepts:
add_action( 'save_post', 'example_callback', 10, 3 );
The exact accepted argument count must match the relevant WordPress hook.
Allowed Memory Size Exhausted
Example:
Allowed memory size of 134217728 bytes exhausted
This is a memory-limit problem rather than direct proof of WordPress 7 incompatibility.
Possible causes include:
- An infinite loop
- A recursive hook
- A very large database query
- Too many form fields
- A plugin conflict
- A low PHP memory limit
Temporarily increasing memory may help confirm the issue:
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );
However, increasing memory does not fix a plugin that contains an infinite loop or inefficient query.
Cannot Redeclare Function or Class
Example:
Cannot redeclare example_function()
This normally means the same PHP file or function is being loaded more than once.
The plugin developer should use proper file loading:
require_once plugin_dir_path( __FILE__ ) . 'includes/functions.php';
Instead of:
require plugin_dir_path( __FILE__ ) . 'includes/functions.php';
Function and class existence checks can also prevent duplicate declarations, but the underlying loading structure should still be corrected.
Parse Error or Syntax Error
Example:
Parse error: unexpected token
This can be caused by:
- A damaged plugin file
- An incomplete update
- Custom code inserted incorrectly
- PHP syntax unsupported by the current server
- A missing bracket, semicolon, or quotation mark
Download a clean copy of the plugin and compare the affected file before manually editing it.
Step 5: Check the PHP Version
WordPress 7.0 raised the minimum supported PHP version to PHP 7.4. WordPress currently recommends PHP 8.3.
Check the active PHP version under:
Tools > Site Health > Info > Server
You can also check it from the hosting control panel.
A WordPress update and PHP update may happen around the same time. The fatal error may appear to have been caused by WordPress 7 when the actual trigger was a PHP version change.
For example:
- The site previously used PHP 8.1.
- The host automatically changed it to PHP 8.3 or PHP 8.4.
- An old plugin contained code that was not compatible with the newer PHP version.
- The error appeared immediately after other website updates.
Test the website on a staging environment using a PHP version supported by:
- WordPress
- The affected plugin
- The active theme
- WooCommerce or other major plugins
- Your hosting environment
Do not downgrade to an unsupported PHP version as a permanent solution.
Step 6: Update the Plugin and Its Dependencies
Open the plugin’s official page or vendor account and check:
- The latest plugin version
- The changelog
- The “Tested up to” value
- PHP requirements
- WordPress 7 compatibility notes
- Required add-ons
- Known issues
- Support forum responses
Update both the main plugin and any premium add-ons. Running a new main plugin with an old extension can cause fatal errors.
Also update:
- The active theme
- The parent theme
- Related integrations
- Page-builder add-ons
- Form extensions
- Payment gateway extensions
Do not assume that an available update is safe for production. Test it on staging first.
Step 7: Reinstall the Plugin
A plugin update can occasionally fail or leave incomplete files.
To rule this out:
- Create a backup.
- Download the plugin settings or export its data if supported.
- Deactivate the plugin.
- Download a clean copy from the official source.
- Replace the plugin files.
- Reactivate it on staging.
- Repeat the action that previously failed.
Do not delete the plugin before confirming whether it removes database tables or settings during uninstallation.
Replacing the files through FTP is often safer when the dashboard update process was interrupted.
Step 8: Perform a Plugin Conflict Test
If the plugin works on a clean WordPress installation but fails on the live site, another plugin may be involved.
On staging:
- Deactivate all plugins except the affected plugin.
- Switch temporarily to a default WordPress theme.
- Test the plugin.
- Reactivate plugins one at a time.
- Test after each activation.
- Note which combination causes the fatal error.
If the problem only returns when a second plugin is active, inspect the debug log again. The conflict may involve:
- Duplicate PHP libraries
- Conflicting function names
- An outdated shared dependency
- Incorrect hook priorities
- Modified REST API responses
- Form security validation
- Caching or optimization
- JavaScript minification
- Database changes
WordPress troubleshooting documentation also recommends deactivating plugins and reactivating them individually to identify an incompatible component.
Step 9: Troubleshoot Fatal Errors During Form Submission
When the website loads normally but submitting a form causes a fatal error, inspect the request that processes the form.
The request may use:
admin-ajax.php- The WordPress REST API
- A custom rewrite endpoint
- A payment gateway webhook
- A scheduled action
- A custom form-processing class
Open the browser’s Developer Tools and select the Network tab.
Submit the form and inspect the failed request. Common HTTP responses include:
500 Internal Server Error403 Forbidden400 Bad Request502 Bad Gateway- An empty response
- Invalid JSON
A 500 response commonly indicates a server-side PHP error. Match the request time with entries in:
/wp-content/debug.log
Also inspect:
- The hosting PHP error log
- The web server error log
- WooCommerce logs, when applicable
- The form plugin’s internal logs
- Security plugin logs
Temporarily Test Caching and Security Rules
On staging, temporarily disable:
- Page caching
- JavaScript delay
- JavaScript combination
- REST API restrictions
- aggressive firewall rules
- Bot protection
- HTML minification
Then test the form again.
Do not leave security or firewall protection disabled on the live website. The purpose of this test is only to determine whether a request is being blocked or modified.
Step 10: Check Custom Code and Must-Use Plugins
The error may not come from a normal plugin.
Also inspect:
/wp-content/mu-plugins/
And check custom code added through:
- The theme’s
functions.php - A child theme
- A code-snippet plugin
- A custom site plugin
- Hosting-specific must-use plugins
- Custom integrations
- Custom checkout or form hooks
WP-CLI’s --skip-plugins option does not automatically skip must-use plugins, so an error may remain even after normal plugins are disabled.
To test custom code safely, disable individual snippets or rename the relevant must-use plugin file on staging.
Step 11: Apply a Temporary Compatibility Patch
When the plugin is abandoned or the developer has not yet released an update, an experienced developer may be able to patch the affected code.
A proper patch should be based on:
- The exact fatal-error message
- The affected PHP file
- The line number
- The surrounding function
- The expected data type
- The WordPress hook or API involved
- The plugin’s update history
Do not suppress the error with the PHP @ operator. Suppressing errors hides the symptom without correcting the problem.
Also avoid editing the plugin directly without documenting the modification. A future plugin update will overwrite the change.
A better temporary approach is to:
- Copy the plugin to a private development repository.
- Apply the compatibility correction.
- Document every changed file.
- Test all plugin functions.
- Test form submissions.
- Test logged-in and logged-out visitors.
- Test scheduled tasks and emails.
- Deploy the patched version.
- Replace it when the official developer releases a proper update.
Should You Downgrade WordPress?
Downgrading WordPress can restore the website temporarily, but it should not be the permanent solution.
WordPress 7.0.2 includes important security fixes. Staying on an older affected version may expose the website to known security problems.
A temporary rollback may be reasonable when:
- The website is business-critical.
- The plugin cannot be replaced immediately.
- You have a verified backup.
- The rollback is performed in a controlled manner.
- Access to the site is protected.
- A permanent compatibility fix is being prepared.
Before rolling back:
- Back up the current site.
- Restore the previous database and files together when necessary.
- Disable automatic core updates temporarily.
- Test the restored site completely.
- Prepare a staging environment with WordPress 7.
- Fix or replace the incompatible plugin.
- Return to the latest secure WordPress version as soon as possible.
Never replace only random WordPress core files from an older version. Mixing core files from different releases can create additional failures.
Is the Plugin Useless on WordPress 7?
Not necessarily.
The plugin may only need:
- A compatibility update
- A clean reinstallation
- A newer premium add-on
- A supported PHP version
- A small code correction
- A conflict resolution
- A replacement for an abandoned dependency
However, replacing the plugin may be the safest option when:
- It has not been updated for a long time.
- The developer no longer provides support.
- It contains unresolved security vulnerabilities.
- It repeatedly breaks after WordPress or PHP updates.
- It stores or processes sensitive information insecurely.
- The cost of maintaining a custom patch is greater than migrating.
For a form-related plugin, make sure the replacement supports all required functionality before migration, including:
- Form fields
- Conditional logic
- Email notifications
- Database storage
- Spam protection
- File uploads
- Third-party integrations
- Privacy requirements
- Export functionality
Recommended Troubleshooting Order
Use this order to resolve the issue efficiently:
- Back up the website.
- Deactivate the affected plugin.
- Restore access to WordPress.
- Enable debug logging.
- Reproduce the error.
- Identify the exact file and line.
- Check the PHP version.
- Update the plugin and add-ons.
- Reinstall clean plugin files.
- Test with other plugins disabled.
- Test with a default theme.
- Check custom code and must-use plugins.
- Apply a tested compatibility patch or replace the plugin.
- Test the entire website on staging.
- Deploy the solution to production.
- Disable debug mode.
- Confirm that WordPress is running the latest secure release.
How to Prevent Fatal Errors During Future WordPress Updates
Major WordPress updates should be tested before they are installed on a production website.
A safer update workflow is:
- Create a fresh backup.
- Copy the website to staging.
- Update WordPress on staging.
- Update plugins and themes.
- Review the PHP error log.
- Test desktop, tablet, and mobile layouts.
- Test forms and email delivery.
- Test login and registration.
- Test checkout and payment processing.
- Test scheduled jobs and integrations.
- Clear all caches.
- Deploy the tested updates to production.
- Review logs again after deployment.
WordPress also encouraged plugin developers and users with complex plugin dependencies to test compatibility during the WordPress 7 release process.
Frequently Asked Questions
Why did my plugin break after updating to WordPress 7?
The plugin may contain outdated PHP code, use an API incorrectly, load files in the wrong order, conflict with another plugin, or require a different PHP version. The exact fatal-error log is required to identify the cause.
How do I access WordPress after a plugin causes a fatal error?
Use WordPress Recovery Mode, rename the plugin directory through FTP or File Manager, or deactivate it through WP-CLI.
Where is the WordPress fatal-error log?
When WP_DEBUG_LOG is enabled, WordPress normally writes errors to:
/wp-content/debug.log
Your hosting provider may also maintain a separate PHP error log.
Can I fix the error by increasing PHP memory?
Only if the error specifically says that the allowed memory size was exhausted. Increasing memory will not fix missing functions, invalid argument types, syntax errors, or plugin conflicts.
Is PHP 7.3 compatible with WordPress 7?
No. WordPress 7.0 requires PHP 7.4 or newer. PHP 8.3 is currently recommended.
Should I edit the plugin directly?
Direct edits may be acceptable as a documented emergency patch, but they will normally be overwritten by future plugin updates. Test the patch on staging and maintain a copy of every modification.
Can I permanently downgrade WordPress?
A downgrade should only be a temporary recovery measure. The safer long-term solution is to update, patch, or replace the incompatible plugin and return to the latest secure WordPress release.
Final Thoughts
A fatal error after upgrading to WordPress 7 does not automatically mean that WordPress is defective or that the affected plugin is completely useless.
The first priority is to restore the website by deactivating the failing component. The next step is to collect the exact PHP error from the WordPress or server log. Once the file, line number, and error type are known, the problem can usually be traced to an outdated plugin, unsupported PHP environment, damaged update, plugin conflict, or incorrect custom code.
Avoid random code changes and permanent WordPress downgrades. Diagnose the actual error, test the correction on staging, and keep both WordPress and PHP on supported, secure versions.