Skip to main content
All CollectionsMainWP Customization
How to limit the number of entries loaded in the Non-MainWP widget
How to limit the number of entries loaded in the Non-MainWP widget
Updated over 2 months ago

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. Navigate to your MainWP Dashboard > Extensions > Custom Dashboard

  2. Open PHP tab

  3. 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; }

  4. 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

Did this answer your question?