• koullis

    (@koullis)


    after 6.6 update i keep getting this health issue

    1 critical issue

    Autoloaded options could affect performance

    Autoloaded options are configuration settings for plugins and themes that are automatically loaded with every page load in WordPress. Having too many autoloaded options can slow down your site. Your site has 1922 autoloaded options (size: 2 MB) in the options table, which could cause your site to be slow. You can review the options being autoloaded in your database and remove any options that are no longer needed by your site.

    • This topic was modified 1 year ago by koullis.
Viewing 8 replies - 1 through 8 (of 8 total)
  • misselenat

    (@misselenat)

    My website had the same issue, even though the size of the autoloaded options was around 800kb. After deleting some parameters (belonging to already uninstalled plugins) from wp_options (inside PHPMyAdmin), I changed the file size limit to 900kb so as to prevent the message from appearing.

    I found the line 2648:

        $limit = apply_filters( 'site_status_autoloaded_options_size_limit', 800000 );

    in wp-admin > includes > class-wp-site-health.php and simply changed 800000 to 900000.

    If the size of your autoloaded options exceeds 1MB, I would address the issue first by removing any old parameters from wp_options inside PHPMyAdmin (make a copy of the database before deleting anything, of course).

    Hope this helps!

    • This reply was modified 1 year ago by misselenat.
    Thread Starter koullis

    (@koullis)

    thanks i managed to make it 1mb but still showed error and then did your solution but this must be done each time an update is available

    You are right about having to do this each time a WordPress update is available, let’s just consider this a workaround until a better solution comes up.

    I’m wondering if there is a way to prevent this value from being overwritten by updates, the same way you can prevent a file belonging to a theme from being updated by putting a copy of the modified file in the theme’s child folder (the child folder always has priority, provided the active theme is the child one of course).

    I will try and see if I find a solution, meantime I’ll just manually change the value after every WordPress udpate.

    • This reply was modified 11 months, 4 weeks ago by misselenat.
    Thread Starter koullis

    (@koullis)

    like you said maybe there is a way through child theme and meantime reedit file on each update

    This might be useful for some people, it is a little snippet I got chatgpt to write for me. Just tested it and it works fine. I manually went through all my options with Meow Apps DB cleaner and disabled autoload from as many old plugins relics as I could recognise. I also have AAA option optimizer on for a few days to see if it helps find unused options that I can clean up.

    Anyway, this would solve the issue you guys have about updates replacing the modified code.

    // Add this to your theme's functions.php or a custom plugin

    function custom_update_autoloaded_options_size_limit($limit) {
    // Set the default custom limit to 999999 bytes (approx. 1MB)
    $custom_limit = get_option('custom_autoloaded_options_size_limit', 999999);

    // Ensure the limit is within a reasonable range (e.g., between 800KB and 999999 bytes)
    if ($custom_limit < 800000) {
    $custom_limit = 800000;
    } elseif ($custom_limit > 999999) {
    $custom_limit = 999999;
    }

    return $custom_limit;
    }

    add_filter('site_status_autoloaded_options_size_limit', 'custom_update_autoloaded_options_size_limit');

    Thank you very much, I will try that next time there is an update!

    I’ve actually created a custom plugin and reinstalled the latest WordPress version – your code works like a charm. Thank you @highlandmoss!

    Thread Starter koullis

    (@koullis)

    @highlandmoss added your snipped and worked after the new update.just adjusted the size

    thank you

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Autoloaded options issue in site Health’ is closed to new replies.