Website Without PHP
English (United States)US
  • English (United States)
  • English (United Kingdom)
  • Dutch (Netherlands)
  • Dutch (Belgium)
Menu

WordPress Theme Breaks on PHP 8: What to Do

The design of your site (the themeA WordPress theme is a ready-made package that decides how your WordPress site looks and how its pages are laid out. Change the theme and the design changes.) does not work with the newer PHP versionA PHP version is a numbered edition of PHP, like 8.3. Each edition is looked after for a limited time, then gets security fixes only, then nothing., so pages can look broken, show warnings or go blank.

Which PHP version does your site report?

We read only what your site already sends in public: the headers and the top of the homepage. No scan, no login.

Get help with your website

More about this

Visitors judge your business on how the site looks, so this is worth fixing quickly.

In most cases the answer is an updated theme or a small repair, not a new website.

Error

When a WordPress theme breaks on PHPPHP is a programming language that builds your web pages on the computer that hosts your site, just before they reach the visitor. WordPress runs on it. 8, it usually means the theme contains code that PHP 8 no longer accepts or handles differently from PHP 7. The site may show a white screen, a critical error message, missing sections or a pile of warnings. The fix is nearly always an updated theme or repaired theme code, not a change in WordPressWordPress is free software for building and editing a website in your browser. It is written in PHP, so it builds each page when someone visits. itself.

What the problem looks like

The symptoms depend on the theme. A fatal error in a core theme file, such as functions.php, can take down the whole site. A problem in a template file may only break one page type.

Warnings can also show up on screen or fill the log without stopping the page, which still tells you the theme needs work.

Common causes

PHP 8 removed some older functions and became stricter about others. Themes that were never updated since the PHP 7 era often use removed functions, pass the wrong type of value to a function, or rely on behavior that PHP 8 changed. Themes that bundle old libraries, page builders or custom option frameworks are especially likely to run into trouble.

A child theme can also break because it copies code from an outdated parent theme.

How to check it safely

Take a backupA backup is a separate copy of your website's files and database, so you can bring the site back after a mistake, a hack or a failed update. of files and database first. Then read the PHP error logAn error log is a file where your website's software writes down what went wrong, with the time and place. It is the first thing to check when a site breaks., which names the theme file and line of the first problem. Check the theme's page or documentation for the PHP versions it supports and for the date of its last update.

Test on a stagingA staging environment is a private copy of your website where you try updates first, so any mistakes happen there and not on the live site. copy of the site if you have one, rather than switching versions on the live site. Do not share admin passwords while asking for help.

What you can try yourself

Try these steps in order. First, update the theme to its latest version, and update the parent theme if you use a child theme. Second, if the site is down, switch back to the earlier PHP version in your hosting control panelA hosting control panel, such as cPanel, Plesk or DirectAdmin, is the web page where you manage your domain, email, databases and PHP version. so visitors can use the site again.

Only switch back to a PHP version that still receives security fixes, keep it as short as possible, and check with your host that it includes the latest security release. Third, if you cannot reach the dashboard, rename the active theme folder through your file manager, so WordPress falls back to a default theme, and then look at the log again. Fourth, if the theme is no longer maintained, ask the author whether a PHP 8 version exists, or plan a move to a maintained theme.

Fifth, avoid editing theme files directly without a backup and a child theme, because an update would overwrite your edits.

When the PHP version is the cause

If the theme runs fine on an older PHP version and breaks on PHP 8, the theme is outdated for the version you want. Staying on an old PHP version is a short term workaround only, since the PHP project stops shipping security fixes for versions it no longer supports. Our page on supported PHP versions explains which versions the PHP project supports right now.

When to get help

If the theme is heavily customized, or the original author is gone, repairing or replacing it is work for someone who can read the code. A human at Website Without PHP replies within 1 business day. An emergency fix starts from $425, excluding VAT.

Frequently asked questions

Do I need a new website if my theme fails on PHP 8?

Usually not. In most cases an updated theme or a small repair of the theme code is enough. A new theme only makes sense when the current one is no longer maintained and repairs keep coming back.

How do I switch to a default theme if I cannot log in?

Rename the folder of the active theme in wp-content/themes through your file manager or FTP. WordPress then falls back to a default theme, if one is installed. Rename the folder back once you know more.

Can a child theme cause the error?

Yes. A child theme can copy code from an older version of its parent theme. Update the parent theme first, then check the files in the child theme that the error log points to.

Can I edit the theme files myself?

Only with a backup and preferably in a child theme. A theme update overwrites edits in the theme itself, so the error can come back after the next update.

  1. Domain
  2. Check
  3. Result
  4. Report

Which PHP version does your site run?

Enter your domain. We read only what your site already sends in public: the headers and the top of the homepage. No scan, no login.

We keep the domain and the result, never your IP address.