The Disk Usage Widget module adds a dashboard widget that shows detailed WordPress disk usage statistics, including core, database, plugins, themes, and uploads. With built-in alerts and customizable thresholds, it helps administrators monitor storage and prevent performance issues.
To enable the Disk Usage Widget Module:
The widget will appear on your WordPress dashboard, showing detailed disk usage information.
The Disk Usage Widget provides three main sections:
Detailed breakdown of your wp-content directory:
The widget includes built-in thresholds that trigger warnings or errors:
You can customize thresholds using filters:
add_filter('wpextended/disk_usage/thresholds', function($thresholds) {
// Change WordPress core warning threshold to 150MB
$thresholds['wordpress_size']['size'] = '150MB';
// Change database warning percentage to 70%
$thresholds['database_size']['percentage'] = 70;
// Change uploads warning threshold to 20GB
$thresholds['wp_content_directories']['uploads']['size'] = '20GB';
return $thresholds;
});
If the widget isn’t displaying correctly:
disk_free_space()disk_total_space()For developers, you can extend the widget’s functionality:
// Add custom directory to WP Content Sizes
add_filter('wpextended/disk_usage/wp_content_directories', function($directories) {
$custom_dir = WP_CONTENT_DIR . '/custom-files';
if (is_dir($custom_dir)) {
$directories['custom-files'] = [
'size' => '2GB', // Warning threshold
'percentage' => 0 // Not using percentage
];
}
return $directories;
});
// Add custom section to the widget
add_action('wpextended/disk_usage/after_widget', function() {
$custom_data = get_custom_disk_usage_data(); // Your custom function
if ($custom_data) {
echo '<h3>Custom Storage</h3>';
echo '<pre>' . esc_html(print_r($custom_data, true)) . '</pre>';
}
});
This module is ideal for:
Still need help? Create a support ticket and our team will get back to you shortly.