Title: Customizer Memory Error
Last modified: October 22, 2025

---

# Customizer Memory Error

 *  Resolved [Nino Mihovilic](https://wordpress.org/support/users/ninomiho/)
 * (@ninomiho)
 * [6 months, 4 weeks ago](https://wordpress.org/support/topic/customizer-memory-error/)
 * When using The Events Calendar plugin and visiting the customizer /wp-admin/customize.
   php?return=%2Fwp-admin%2Fthemes.php with any theme that supports the customizer,
   I encounter the “Allowed memory size” error in /wp-includes/class-wpdb.php. I
   attempted to set the memory limit to 512MB, but the error still occurs. I tested
   it with the Astra theme and other themes on a clean install. As soon as I disable
   the plugin it works again.
 * Hi!
 * System information:
    -  This topic was modified 6 months, 3 weeks ago by [Yui](https://wordpress.org/support/users/fierevere/).
      Reason: pi removed

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Atousa Najafi](https://wordpress.org/support/users/atousanajafi/)
 * (@atousanajafi)
 * [6 months, 4 weeks ago](https://wordpress.org/support/topic/customizer-memory-error/#post-18690401)
 * Hi [@ninomiho](https://wordpress.org/support/users/ninomiho/),
 * Please do not share any sensitive information, including system information, 
   in WordPress Forums; this is for us to follow the [WordPress Forum Guidelines](https://wordpress.org/support/guidelines/).
   If possible, edit the ticket and remove the system information, or ask the moderator
   to do this.
 * I’m unable to reproduce this issue on my website with Astra or other themes, 
   so there could be a server-related issue. Have you tried contacting your hosting
   provider? Are there any other errors in the [log file](https://theeventscalendar.com/knowledgebase/how-to-enable-debugging-in-wordpress/)?
   
   Does increasing the memory to 1024M solve the problem?
 *  Thread Starter [Nino Mihovilic](https://wordpress.org/support/users/ninomiho/)
 * (@ninomiho)
 * [6 months, 3 weeks ago](https://wordpress.org/support/topic/customizer-memory-error/#post-18690904)
 * Hi Atousa!
 * The issue occurs because I have over 2,000 events in the plugin. I’ve limited
   the `tribe_events` per page to 10 in the customizer, and now it works. Here is
   the code in case someone else encounters the same issue.
 *     ```wp-block-code
       /** * Cap Events Calendar queries for customizer preview for memory issues. * * @param WP_Query $current_query The current query object. * * @return void */function mc_limit_tribe_queries( $current_query ) {	if ( ! ( $current_query instanceof WP_Query ) ) {		return;	}	if ( 'tribe_events' !== $current_query->get( 'post_type' ) ) {		return;	}	if ( ! is_customize_preview() ) {		return;	}	$posts_per_page = (int) $current_query->get( 'posts_per_page' );	if ( $posts_per_page <= 0 || $posts_per_page > 10 ) {		$current_query->set( 'posts_per_page', 10 );	}	$current_query->set( 'no_found_rows', true );	$current_query->set( 'update_post_meta_cache', false );	$current_query->set( 'update_post_term_cache', false );}add_action( 'pre_get_posts', 'mc_limit_tribe_queries', 9 );
       ```
   
 * I’ve reported the topics to the moderators to remove the system information from
   my first message.
 *  Plugin Support [tristan083](https://wordpress.org/support/users/tristan083/)
 * (@tristan083)
 * [6 months, 3 weeks ago](https://wordpress.org/support/topic/customizer-memory-error/#post-18691024)
 * Hi [@ninomiho](https://wordpress.org/support/users/ninomiho/) ,
 * Thank you for your message.
 * We’re glad to hear that you were able to sort this one out, and we appreciate
   you sharing your code/solution.
 * I’ll be closing this thread, as there are no further actions needed, but please
   do not hesitate to bump a new thread on our way if you have further questions/
   concerns. This is for us to track down topics/issues efficiently and for us to
   adhere to the [WordPress Forum Guidelines](https://wordpress.org/support/guidelines/).
 * If you have some time to review, that would be amazing!
   [https://wordpress.org/support/plugin/the-events-calendar/reviews/](https://wordpress.org/support/plugin/the-events-calendar/reviews/)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Customizer Memory Error’ is closed to new replies.

 * ![](https://ps.w.org/the-events-calendar/assets/icon-256x256.gif?rev=2516440)
 * [The Events Calendar](https://wordpress.org/plugins/the-events-calendar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/the-events-calendar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/the-events-calendar/)
 * [Active Topics](https://wordpress.org/support/plugin/the-events-calendar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/the-events-calendar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/the-events-calendar/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [tristan083](https://wordpress.org/support/users/tristan083/)
 * Last activity: [6 months, 3 weeks ago](https://wordpress.org/support/topic/customizer-memory-error/#post-18691024)
 * Status: resolved