Guides › HTML / PHP sites › Site down or error screens

PHP Undefined Variable, Index or Array Key Notices: What They Mean

Notices point to code that uses unset values.

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.
Site down or error page

Notices such as Undefined variable, Undefined index or Undefined array key mean the code used something before it was set. They are warnings, not crashes, but they fill your logs and may show on the page.

1Read the message2Find out whose file it is3Update the plugin or theme4Hide the notices on live sites5Fix your own code6Report it7Check the log sizeFixed? Test the site. If not, get help.
The steps in order. Work down the list and stop when the problem is solved.

Step 1: Read the message

Illustration for Step 1: Read the message

It names the variable or key, the file and the line number. For example: Undefined array key "name" in /wp-content/plugins/x/file.php on line 42.

Step 2: Find out whose file it is

Illustration for Step 2: Find out whose file it is

If the path is in wp-content/plugins/... or themes/..., the plugin or theme is responsible, not WordPress.

Step 3: Update the plugin or theme

Illustration for Step 3: Update the plugin or theme

Most authors fix these in updates.

Step 4: Hide the notices on live sites

Illustration for Step 4: Hide the notices on live sites

In wp-config.php set WP_DEBUG to false, or set WP_DEBUG_DISPLAY to false and WP_DEBUG_LOG to true, so visitors never see them.

Step 5: Fix your own code

Illustration for Step 5: Fix your own code

Check that a variable or key exists before using it, for example with isset() or ??.

Step 6: Report it

Illustration for Step 6: Report it

Tell the plugin author with the exact message.

Step 7: Check the log size

Illustration for Step 7: Check the log size

Delete or rotate large log files.

Still stuck?

If these steps do not solve it, we fix it for you for a flat $99. Full refund if we do not solve it within 7 days.

Related guides

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.

Last updated 2026-11-22.