Halloween Sale 15% off Ends in See the plans
PHP

wp-config.php Settings Overview Under Tools

Adds a Tools > Config Constants screen that shows the value of important wp-config.php settings, such as debug mode, memory limits, cron, caching and file editing, without opening the file.

Don’t have WPIDE yet? Install it on your site

Code

// Constants to display.
$wpide_config_constants = array( 'WP_ENVIRONMENT_TYPE', 'WP_DEBUG', 'WP_DEBUG_LOG', 'WP_DEBUG_DISPLAY', 'SCRIPT_DEBUG', 'SAVEQUERIES', 'WP_MEMORY_LIMIT', 'WP_MAX_MEMORY_LIMIT', 'WP_CACHE', 'DISABLE_WP_CRON', 'ALTERNATE_WP_CRON', 'WP_CRON_LOCK_TIMEOUT', 'WP_POST_REVISIONS', 'AUTOSAVE_INTERVAL', 'EMPTY_TRASH_DAYS', 'DISALLOW_FILE_EDIT', 'DISALLOW_FILE_MODS', 'AUTOMATIC_UPDATER_DISABLED', 'WP_AUTO_UPDATE_CORE', 'FORCE_SSL_ADMIN', 'CONCATENATE_SCRIPTS', 'COMPRESS_SCRIPTS', 'WP_HOME', 'WP_SITEURL', 'WP_CONTENT_DIR', 'UPLOADS', 'DB_CHARSET', 'DB_COLLATE', 'WP_ALLOW_REPAIR', 'MULTISITE' );

add_action( 'admin_menu', function () use ( $wpide_config_constants ) {
    add_management_page( 'Config Constants', 'Config Constants', 'manage_options', 'wpide-config-constants', function () use ( $wpide_config_constants ) {
        echo '<div class="wrap"><h1>wp-config.php Constants</h1><table class="widefat striped" style="max-width:900px"><thead><tr><th>Constant</th><th>Value</th></tr></thead><tbody>';
        foreach ( $wpide_config_constants as $name ) {
            if ( preg_match( '/KEY|SALT|PASSWORD|SECRET|TOKEN/', $name ) ) {
                continue;
            }
            if ( ! defined( $name ) ) {
                $value = '<em>not set</em>';
            } else {
                $raw   = constant( $name );
                $value = '<code>' . esc_html( is_bool( $raw ) ? ( $raw ? 'true' : 'false' ) : var_export( $raw, true ) ) . '</code>';
            }
            printf( '<tr><td><code>%s</code></td><td>%s</td></tr>', esc_html( $name ), $value );
        }
        echo '</tbody></table></div>';
    } );
} );

Notes

Secret keys, salts and database passwords are never shown; add more names to $wpide_config_constants.

How to add this snippet

  1. Install WPIDE on your WordPress site (it is free) and open Code Snippets.
  2. Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
  3. It is added inactive: review the code and settings, then switch it on.

Have a snippet worth sharing?

Publish it to the library from WPIDE or right here. Sign in with any WordPress site that runs WPIDE, free or Pro. Public snippets are reviewed by the WPIDE team before they appear.

Which site should get this snippet?

Enter the address of your WordPress site. WPIDE opens there in a new tab with the snippet ready to review and save.

Remembered in this browser only, so you are asked once.

Report this snippet

Tell the WPIDE team what is wrong: broken code, something harmful, spam or copied work.