How can we help?

Table of Contents

Limit the number of entries loaded in the Non-MainWP Widget

For Dashboards with a large number of Child Sites (a few hundred and more), the number of entries logged in the Non-MainWP widget can grow to many thousands.

This can slow down the load time of the Overview page on which the Non-MainWP Widget is located.

To decrease the load time, add the following code snippet to your MainWP Dashboard:

add_filter( 'mainwp_widget_site_actions_limit_number', 'mycustom_mainwp_widget_site_actions_limit_number' );
function mycustom_mainwp_widget_site_actions_limit_number( $value ) {
return 200;
}

 

Using MainWP Custom Dashboard Extension

  1. Install MainWP Custom Dashboard extension
  2. Navigate to your MainWP Dashboard > Extensions > Custom Dashboard
  3. Open PHP tab
  4. Add the following code snippet
    add_filter( 'mainwp_widget_site_actions_limit_number', 'mycustom_mainwp_widget_site_actions_limit_number' );
    function mycustom_mainwp_widget_site_actions_limit_number( $value ) {
    return 200;
    }

    Limit the number of entries loaded in the Non-MainWP Widget 1

  5. Click Save Changes button

 

Editing functions.php file

  1. Navigate to the WordPress dashboard where your MainWP is installed
  2. Go to Tools > Theme File Editor
  3. On the right, locate the Theme Functions (functions.php) file and click on it
    Note: If you are not using a Child Theme, a theme update will overwrite this file. So, in that case, you can insert the snippet using a plugin like Code Snippets.
  4. Add the following code snippet to the end of the file
    add_filter( 'mainwp_widget_site_actions_limit_number', 'mycustom_mainwp_widget_site_actions_limit_number' ); function mycustom_mainwp_widget_site_actions_limit_number( $value ) { return 200; }
  5. Click Update File button
Still Have a Questions?
Search for additional solutions in the MainWP Community or start your own discussion