{"id":1963480,"date":"2024-11-28T11:13:21","date_gmt":"2024-11-28T16:13:21","guid":{"rendered":"https:\/\/theeventscalendar.com\/knowledgebase\/?p=1963480"},"modified":"2025-10-23T12:28:41","modified_gmt":"2025-10-23T16:28:41","slug":"modify-limit-recurring-events-ecp","status":"publish","type":"post","link":"https:\/\/theeventscalendar.com\/knowledgebase\/modify-limit-recurring-events-ecp\/","title":{"rendered":"How to Modify the Recurring Events Limit in The Events Calendar Pro"},"content":{"rendered":"\n<p>By default, when creating a recurring event with the &#8220;Ends&#8221; option set to &#8220;Never,&#8221; the system will automatically generate events for up to <strong>60 months (five years)<\/strong> from the start date based on the recurrence pattern you have specified. This limit ensures that the database is not overwhelmed by an excessive number of generated events, which could negatively impact performance.<\/p>\n\n\n\n<p>If you need to adjust this behavior, you can use the snippet below to redefine the number of months for which events are generated. This can help tailor the recurrence duration to your specific requirements while balancing server and database efficiency.<\/p>\n\n\n\n<p>Please paste this snippet within your themes\u00a0<em>function.php<\/em>\u00a0file or use this handy\u00a0<a href=\"https:\/\/wordpress.org\/plugins\/code-snippets\/\" target=\"_blank\" rel=\"noreferrer noopener\">Code Snippets plugin<\/a>. You can learn more about using custom code snippets in our\u00a0<a href=\"https:\/\/theeventscalendar.com\/knowledgebase\/k\/best-practices-for-implementing-custom-code-snippets\/\" target=\"_blank\" rel=\"noreferrer noopener\">knowledegebase<\/a>.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: css; title: ; notranslate\" title=\"\">\n\/\/ Add the tribe_get_option_recurrenceMaxMonthsAfter filter\nfunction custom_recurrence_max_months( $value ) {\n    return 120;\n    \/\/change this number to whatever your desired number of max recurrence months is\n}\nadd_filter( &#039;tribe_get_option_recurrenceMaxMonthsAfter&#039;, &#039;custom_recurrence_max_months&#039; );\n<\/pre><\/div>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default, when creating a recurring event with the &#8220;Ends&#8221; option set to &#8220;Never,&#8221; the system will automatically generate events for up to 60 months (five years) from the start date based on the recurrence pattern you have specified. This limit ensures that the database is not overwhelmed by an excessive number of generated events,&#8230;<\/p>\n","protected":false},"author":46,"featured_media":1955565,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_swpsp_post_exclude":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"ep_exclude_from_search":false,"footnotes":""},"categories":[67],"tags":[],"stellar-product-taxonomy":[158],"class_list":["post-1963480","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-recurring-events","stellar-product-taxonomy-events-calendar-pro"],"acf":[],"taxonomy_info":{"category":[{"value":67,"label":"Recurring Events"}],"stellar-product-taxonomy":[{"value":158,"label":"Events Calendar Pro"}]},"featured_image_src_large":["https:\/\/images.theeventscalendar.com\/kb\/uploads\/2023\/02\/social-share-1024x538.png",1024,538,true],"author_info":{"display_name":"Iris Irvin","author_link":"https:\/\/theeventscalendar.com\/knowledgebase\/author\/iris\/"},"comment_info":0,"category_info":[{"term_id":67,"name":"Recurring Events","slug":"recurring-events","term_group":0,"term_taxonomy_id":67,"taxonomy":"category","description":"","parent":61,"count":12,"filter":"raw","term_order":"0","cat_ID":67,"category_count":12,"category_description":"","cat_name":"Recurring Events","category_nicename":"recurring-events","category_parent":61}],"tag_info":false,"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1963480","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/users\/46"}],"replies":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=1963480"}],"version-history":[{"count":9,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1963480\/revisions"}],"predecessor-version":[{"id":1966476,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1963480\/revisions\/1966476"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media\/1955565"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=1963480"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1963480"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1963480"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1963480"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}