Skip to content

Instantly share code, notes, and snippets.

@cdsaenz
Created February 26, 2025 14:58
Show Gist options
  • Save cdsaenz/b260041019484c89f05327531db7761c to your computer and use it in GitHub Desktop.
Save cdsaenz/b260041019484c89f05327531db7761c to your computer and use it in GitHub Desktop.
WordPress wp-config.php settings for development (avoid logging deprecated and notices)
<?php
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
define( 'FS_METHOD', 'direct' );
// Adjust as per your server/php memory
define( 'WP_MEMORY_LIMIT', '1024M' );
// Don't log deprecated errors etc
function csdev_error_handler($errno, $errstr, $errfile, $errline)
{
if ($errno == E_DEPRECATED
|| $errno == E_USER_DEPRECATED
|| $errno == E_NOTICE
|| $errno = E_USER_NOTICE) {
return true;
}
// Let WordPress handle other errors normally
return false;
}
set_error_handler('csdev_error_handler');
/* That's all, stop editing! Happy publishing. */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment