{"id":1965062,"date":"2025-05-06T07:53:13","date_gmt":"2025-05-06T11:53:13","guid":{"rendered":"https:\/\/theeventscalendar.com\/knowledgebase\/?p=1965062"},"modified":"2025-11-21T03:32:00","modified_gmt":"2025-11-21T08:32:00","slug":"using-wp-cli-with-the-events-calendar-a-quick-guide","status":"publish","type":"post","link":"https:\/\/theeventscalendar.com\/knowledgebase\/using-wp-cli-with-the-events-calendar-a-quick-guide\/","title":{"rendered":"Using WP-CLI with The Events Calendar: A Quick Guide"},"content":{"rendered":"\n<p>If you&#8217;re managing a site powered by our calendar and tickets plugin, using WP-CLI (<a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/\">WordPress Command Line Interface<\/a>) can save you significant time when managing events, running imports, or diagnosing performance issues. Below is a quick guide on the available WP-CLI commands offered by our plugins and how to use them effectively.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>To execute the below commands, you will need to first download and install the <a href=\"https:\/\/github.com\/the-events-calendar\/tec-cli\" target=\"_blank\" rel=\"noreferrer noopener\">TEC CLI Plugin<\/a> on your website.<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-event-management\">Event Management<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-generate-dummy-events\">Generate Dummy Events<\/h4>\n\n\n\n<p>Create sample events to test your calendar:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wp tribe events-generator generate --count=1000<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-reset-events\">Reset Events<\/h4>\n\n\n\n<p>Remove all test events, organizers, and venues:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wp tribe events-generator reset<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><em>Requires The Events Calendar version 4.5.4 or higher.<\/em><\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-event-aggregator\">Event Aggregator<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-import-events-from-external-source\">Import Events from External Source<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>wp event-aggregator import-from --origin=ical --source=https:\/\/example.com\/events.ics<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"h-additional-options\">Additional options:<\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>--keywords=<\/code> Filter events by keyword<\/li>\n\n\n\n<li><code>--location=<\/code> Filter by location<\/li>\n\n\n\n<li><code>--radius=<\/code> Define location radius<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-run-scheduled-import\">Run Scheduled Import<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>wp event-aggregator run-import &lt;import-id&gt;<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"h-optional\">Optional:<\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>--timeout=<\/code> Set timeout duration (seconds)<\/li>\n\n\n\n<li><code>--format=<\/code> Specify output format<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-testing-amp-diagnostics\">Testing &amp; Diagnostics<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-generate-load-test-events\">Generate Load Test Events<\/h4>\n\n\n\n<p>Create events between two dates:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wp tec-load-test 2024-01-01 2024-01-15 30<\/code><\/pre>\n\n\n\n<p>(Generates 30 events per day in that date range.)<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-check-mysql-max-packet-size\">Check MySQL Max Packet Size<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>wp tec-mysql-packet-size<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-count-events\">Count Events<\/h4>\n\n\n\n<p>All events:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wp tec-count<\/code><\/pre>\n\n\n\n<p>Published events:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wp tec-count --status=publish<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-tickets-amp-attendees\">Tickets &amp; Attendees<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-generate-rsvp-attendees\">Generate RSVP Attendees<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>wp tribe event-tickets generate-rsvp-attendees &lt;event-id&gt; --count=50<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-reset-rsvp-attendees\">Reset RSVP Attendees<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>wp tribe event-tickets reset-rsvp-attendees &lt;event-id&gt;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-generate-woocommerce-orders\">Generate WooCommerce Orders<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>wp tribe event-tickets-plus generate-wc-orders &lt;event-id&gt; --count=10<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-reset-woocommerce-orders\">Reset WooCommerce Orders<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>wp tribe event-tickets-plus reset-wc-orders &lt;event-id&gt;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-final-thoughts\">Final Thoughts<\/h2>\n\n\n\n<p>WP-CLI support makes The Events Calendar even more powerful for developers and site managers. Whether you&#8217;re bulk-generating events or diagnosing database performance, these commands can streamline your workflows.<\/p>\n\n\n\n<p>For more details, you can check the official The Events Calendar CLI documentation here: <a href=\"https:\/\/github.com\/the-events-calendar\/tec-cli\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/github.com\/the-events-calendar\/tec-cli<\/a><\/p>\n\n\n\n<p>If you&#8217;d like help running any of these commands or troubleshooting specific scenarios, feel free to <a href=\"https:\/\/theeventscalendar.com\/support\/\">reach out<\/a>!<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re managing a site powered by our calendar and tickets plugin, using WP-CLI (WordPress Command Line Interface) can save you significant time when managing events, running imports, or diagnosing performance issues. Below is a quick guide on the available WP-CLI commands offered by our plugins and how to use them effectively. To execute the&#8230;<\/p>\n","protected":false},"author":64,"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":[24],"tags":[25,260],"stellar-product-taxonomy":[],"class_list":["post-1965062","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-customizing","tag-customizations","tag-wordpress-cli"],"acf":[],"taxonomy_info":{"category":[{"value":24,"label":"Customizations"}],"post_tag":[{"value":25,"label":"Customizations"},{"value":260,"label":"WordPress CLI"}]},"featured_image_src_large":["https:\/\/images.theeventscalendar.com\/kb\/uploads\/2023\/02\/social-share-1024x538.png",1024,538,true],"author_info":{"display_name":"Jes","author_link":"https:\/\/theeventscalendar.com\/knowledgebase\/author\/jes\/"},"comment_info":0,"category_info":[{"term_id":24,"name":"Customizations","slug":"customizing","term_group":0,"term_taxonomy_id":24,"taxonomy":"category","description":"","parent":0,"count":53,"filter":"raw","term_order":"0","cat_ID":24,"category_count":53,"category_description":"","cat_name":"Customizations","category_nicename":"customizing","category_parent":0}],"tag_info":[{"term_id":25,"name":"Customizations","slug":"customizations","term_group":0,"term_taxonomy_id":25,"taxonomy":"post_tag","description":"","parent":0,"count":36,"filter":"raw","term_order":"0"},{"term_id":260,"name":"WordPress CLI","slug":"wordpress-cli","term_group":0,"term_taxonomy_id":260,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw","term_order":"0"}],"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1965062","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\/64"}],"replies":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=1965062"}],"version-history":[{"count":7,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1965062\/revisions"}],"predecessor-version":[{"id":1967723,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1965062\/revisions\/1967723"}],"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=1965062"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1965062"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1965062"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1965062"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}