Site Broke After a PHP Version Upgrade: Deprecated and Removed Functions
Your host moved you to a newer PHP and the site now errors. Roll back for now, then update the code or plugins that are too old.
Reference guide. This guide is written from established practice and the official documentation of the tools involved. We have not yet tested every step on a live demo site. Back up your site before you change anything.
New PHP versions remove or change old features. Old code and old plugins that relied on them then fail.
Step 1: Get the site back
In your hosting panel, open the PHP configuration and select your previous PHP version. This is a short-term fix. Old versions stop receiving security updates, so plan to update.
Step 2: Read the error
Check the error log, or see our PHP error guide. The message names the file and the function.
Step 3: Common causes in PHP 8
- Functions removed in PHP 8, such as
create_function()andeach(). - Curly-brace string offsets like
$string{0}, now replaced by$string[0]. - Stricter rules for the types you pass to functions, causing "Uncaught TypeError".
- Required parameters placed after optional ones, giving deprecation notices.
- In PHP 8.2 and later, creating undeclared properties on objects is deprecated.
Step 4: Update, do not patch blindly
- WordPress: update the plugin or theme. If it is abandoned, replace it. See our rollback guide.
- Custom code: fix the line the error names, or ask the developer to.
Step 5: Test on a copy
Ask your host for a staging site, or copy the site to a test folder, and try the newer version there first.
Related guides
- WordPress White Screen of Death: How to Fix a Blank Page
- WordPress Theme Broke the Site: Switch Back to a Default Theme Without Dashboard Access
- WordPress Posts or Pages Show 404 Not Found but the Homepage Works
- WordPress Pages Show 404 Not Found (Posts Work, Pages Do Not)
Did this solve it? If not, email hello@sitefixlab.org with the exact error text and we will look into it. Try the problem finder.