• Hello. When WordPress has fatal error the users see the grey ‘A critical error’ has occured message. As a web developer I know what this means. But as a customer a site it can be scary or confusing. Yes, I know that in an ideal world this message would never show to customers.

    I know you can make a custom maintenance.php template for maintenance mode message. is there the same option for a custom error notice. I would like to design something that’s a little more helpful and less scary for customers. For example, something like:

    “Sorry, something went wrong and we couldn’t load this page. Please refresh or go back”. And then make it pretty with the customers logo and some other pretty plain html stuff.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Dion

    (@diondesigns)

    There are multiple methods to change the default error display. Take a look at the comments in the wp-includes/class-wp-fatal-error-handler.php file, try out the methods described in the comments, and see which method works best for your needs.

    Thread Starter katmacau

    (@katmacau)

    Thank you. Will give that a go.

    Thread Starter katmacau

    (@katmacau)

    I’ve found that file and read over it. I can see it mentions:

    “This method is called conditionally if no ‘php-error.php’ drop-in is available.”

    Doe that mean I create a file called “php-error.php” and put that in my wp-content folder? If so, what do I need to include the file for it to be valid/appropriate? Eg does it need a 503 header?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Create a custom fatal error page’ is closed to new replies.