WordPress.org

Support

Support » How-To and Troubleshooting » Changing wp_error to display generalized error message

Changing wp_error to display generalized error message

  • Hi, I need to make sure my error messsages don’t spit out an error message that shows the server directory structure, so making a generalized error message would be ideal.

    I tried fiddling with /wp-includes/class-wp-error.php but I couldn’t get it to work.

    I’ve put example codes from tutorials at the bottom of my functions.php file but it just spits the new error message out in my header even though nothing else has been modified.

    I’m somewhat of a beginner with PHP, please help!!

    thanks so much

    -S

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

    @esmi

    Forum Moderator

    Never, ever, edit WordPress core scripts as this can bring down your entire site and/or open security holes for hackers to use.

    If you don’t want error messages displayed, then this is best handled at the server level via the php.ini file

    Thanks so much for your reply.

    How exactly would I modify the php.ini file to display a generalized message such as “An error has occurred, please contact webmaster..”

    I need to tweak my exception handling module to block stack traces and display a generic message.

    I know I can switch line 277 from ON to OFF

    but I need to make a new error message..

    –Anyone?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Changing wp_error to display generalized error message’ is closed to new replies.