Category: WordPress

If you’ve ever logged into your server and found an error_log file that’s hundreds of megabytes—or worse, several gigabytes—you know how quickly things can spiral. 

WordPress by default stores the logs (if enabled) in wp-content/debug.log.

If you want to know how to enable the WP_DEBUG check this article from WPSandbox at How to Enable Debugging Mode in WordPress

These oversized log files are rarely caused by WordPress itself. In most cases, the culprits are plugins or themes that were developed without proper error reporting enabled, or they hook into WordPress at the wrong point in the lifecycle and WordPress or generate warnings but nobody can see them because WordPress won't display the errors unless instructed.

Left unchecked, these errors and notices don’t just clog your logs—they can consume valuable server resources, obscure critical issues, and in some cases, even lead to your hosting provider suspending your site for exceeding storage limits. They cause constant disk operations to save the errors.

This guide covers a simple, production-safe method to suppress non-critical PHP errors and warnings, and lays out a few essential practices to keep your WordPress logs lean, manageable, and useful.

Why WordPress logs grow out of control

WordPress itself is not particularly verbose in production environments. Most notices and warnings you see in your logs come from:

  • Plugins or themes that don’t use WordPress hooks correctly—calling functions too early or too late
  • Deprecated functions that should have been updated years ago
  • Undefined variables or poor coding practices that go unnoticed during development
  • Overly aggressive debugging output left active in production code
  • Upgraded php version but the plugin or the theme are not compatibile with it just yet.

These issues may seem minor, but when they trigger warnings on every page load, across thousands of hits per day, your logs can grow pretty quickly.

Why large logs are a real problem

Oversized log files aren’t just annoying—they can break things. Here’s how:

  • They fill up your server’s disk quota, sometimes without warning
  • They slow down file reads and writes, affecting overall performance
  • They make debugging harder by burying real issues in a flood of noise
  • Some hosting companies may even suspend your site or shut off logging entirely if usage goes beyond their limits

Keeping your logs under control isn’t just good hygiene—it’s critical for uptime and maintainability.

The fix: suppress the noise with a must-use plugin

Here’s a lightweight way to reduce log clutter by filtering out common non-fatal PHP error types. This plugin works best as a must-use (MU) plugin, which ensures it loads before anything else and can’t be disabled from the WordPress admin.

Important Note: WP_DEBUG must be enabled in your wp-config.php for this work.

How to install the plugin

  1. Navigate to wp-content/mu-plugins/. Create the folder if it doesn’t exist.
  2. Create a new file: 000-suppress-errors.php (starting with 000 ensures it loads early)
  3. Paste the code below and save the file

<?php
/**
 * Plugin Name: Orbisius Quick Error Suppressor
 * Description: Suppresses deprecated warnings, notices, and warnings during debugging. Visit https://orbisius.com/7946 for more info. 
 * Author: Orbisius
 * Version: 1.0.0
 * Disclaimer: This plugin is provided "as is", without warranty of any kind.
 * Use at your own risk. The author is not responsible for any damage or data loss.
 */

// Exit if accessed directly.
if (!defined('ABSPATH')) {
    exit;
}

if (!function_exists('orbisius_quick_error_suppressor')) {
    /**
     * Custom error handler to suppress specific types of warnings and notices.
     *
     * @param int $err_no Error level.
     * @param string $err_str Error message.
     * @param string $err_file Filename the error was raised in.
     * @param int $err_line Line number the error occurred on.
     * @return bool True to suppress the error, false to let it be handled normally.
     */
    function orbisius_quick_error_suppressor($err_no, $err_str, $err_file, $err_line) {
        $suppressed_errors = [
            E_DEPRECATED,
            E_USER_DEPRECATED,
            E_NOTICE,
            E_USER_NOTICE,
            E_WARNING,
            E_USER_WARNING,
        ];

        if (in_array($err_no, $suppressed_errors, true)) {
            return true; // Suppress the error.
        }

        return false; // Allow other errors to be handled normally.
    }
}

// Apply the custom error handler only if debugging is enabled.
if (defined('WP_DEBUG') && WP_DEBUG) {
    set_error_handler('orbisius_quick_error_suppressor');
}

This plugin activates automatically. There’s no settings page. It simply intercepts PHP notices and warnings and stops them from being logged.

Important: don't use this in development

During development or staging, you want to see every single warning, notice, and deprecated function call if it's coming from your plugin or theme though. These are signals that help you improve your codebase.

Use this suppressor plugin only on production servers, where performance and stability are the priorities, and you want to avoid filling up your logs with non-critical noise.

Additional steps to control log from growth

Suppressing warnings is step one. For long-term log management, here are some additional best practices:

Implement log rotation

If your host doesn’t rotate logs automatically, they’ll keep growing. Use server-side tools like logrotate, or implement a plugin-based solution like Orbisius Log Optimizer to periodically trim or archive logs based on size or age.

Monitor log file size

Set up a cron job or dashboard alert to track log file size. If your error_log or debug.log crosses a set threshold (e.g. 100MB), trigger a warning or automatic cleanup.

Disable WP_DEBUG in production

Make sure debugging is turned off unless you’re troubleshooting:

sql

define('WP_DEBUG', false);

When enabled, use error suppressors to keep logs clean without losing control.

Review logs periodically on WordPress staging sites such as qSandbox.com or WPSandbox.net

Download and review logs from production on a staging environment. Identify plugins or themes that consistently throw warnings, and either fix them, contact the developer, or replace them with more reliable alternatives.

Want deeper control? Use Orbisius Log Optimizer

The Orbisius Quick Error Suppressor plugin is perfect for getting things under control quickly and especially if you're more technical and know how to use web based file managers or SFTP programs.

If you want an easier solution that provides you with a nice and easy to use interface maybe you should checkout Orbisius Log Optimizer . It gives you more control of what errors to ignore or not depending on what caused the errors (by path)

Orbisius Log Optimizer provides:

  • Suppressing the errors by selected directories.
  • Allows to still log the errors (exclude list) from a directories that's within the included paths.
  • Specify debug IPs so errors from users having those IPs won't be ignored.
  • Optionally enable tracking, so you can see how much space the plugin has saved you.
  • Efficient

It’s built specifically for WordPress environments that demand performance, reliability, and minimal maintenance.

Conclusion

Your WordPress logs should be a tool that allows you to troubleshoot issues more easily, not a liability. Oversized logs are usually the result of badly or not well tested code, not WordPress itself. By ignoring non-critical errors, rotating logs, and actively monitoring what’s going on behind the scenes, you can avoid performance issues, save disk space, and stay on your hosting provider’s good side.

Start using the Quick Error Suppressor plugin to keep things quiet or use Orbisius Log Optimizer for more over your WordPress site's logs.

Join our mailing list

Get important news about cool products we release and invitations to beta test new products

Find out the Social networks we're on

We have a new plugin that helps you reduce log files called Orbisius Log Optimizer