{"id":46908,"date":"2023-06-28T10:29:07","date_gmt":"2023-06-28T08:29:07","guid":{"rendered":"https:\/\/gtechgroup.it\/?p=46908"},"modified":"2023-06-28T10:29:07","modified_gmt":"2023-06-28T08:29:07","slug":"guida-alla-pulizia-delle-tabelle-action-scheduler-in-wordpress","status":"publish","type":"post","link":"https:\/\/gtechgroup.it\/blog\/en\/guida-alla-pulizia-delle-tabelle-action-scheduler-in-wordpress\/","title":{"rendered":"Guide to Cleaning the Action Scheduler Tables in WordPress"},"content":{"rendered":"<p>The maintenance of your WordPress site isn\u2019t limited only to updating themes and plugins or creating new content. An equally important, but often overlooked, aspect is the <strong>effective management of the database<\/strong>. In particular, two tables that can become quite large and potentially affect your site\u2019s performance are <code>actionscheduler_actions<\/code> and <code>actionscheduler_logs<\/code>.<\/p>\n<h2>What is Action Scheduler and which tables does it use?<\/h2>\n<p>Action Scheduler is a tool that many WordPress plugins, such as WooCommerce, use to <strong>manage scheduled tasks<\/strong>, also called \u201ccron jobs\u201d. These tasks are operations that your site runs automatically in the background, for example sending notification emails, generating reports, and so on.<\/p>\n<p>The tables <code>actionscheduler_actions<\/code> and <code>actionscheduler_logs<\/code> respectively store these scheduled tasks and the logs of their executions. Over time, these tables can accumulate a huge amount of data, especially if your site runs many scheduled tasks.<\/p>\n<h2>Preparing for the database cleanup<\/h2>\n<p>Before proceeding with the cleaning of these tables, there are some important precautions to consider:<\/p>\n<p><strong>1. Data backup:<\/strong> No matter how sure you are of what you\u2019re doing, it\u2019s always essential to make a backup of your database before making significant changes. Plugins such as <a href=\"https:\/\/updraftplus.com\/\" target=\"_new\" rel=\"noopener\">UpdraftPlus<\/a> or <a href=\"https:\/\/ithemes.com\/backupbuddy\/\" target=\"_new\" rel=\"noopener\">BackupBuddy<\/a> can help you do this easily and safely.<\/p>\n<p><strong>2. Knowledge of the system:<\/strong> Before you start deleting data from the tables, make sure you understand which tasks are managed by Action Scheduler on your site. Deleting data related to crucial tasks could have undesirable consequences.<\/p>\n<h2>How to clean the database tables<\/h2>\n<p>There are several methods to clean the tables <code>actionscheduler_actions<\/code> and <code>actionscheduler_logs<\/code>. Here are three of the most effective methods:<\/p>\n<p><strong>1. Using WP-CLI:<\/strong> If you have access to WP-CLI, the WordPress command-line interface, you can use the commands provided by Action Scheduler to clean up completed or failed actions. The command to use is <code>wp action-scheduler run --cleanup<\/code>.<\/p>\n<p><strong>2. Database cleaning plugins:<\/strong> There are numerous WordPress plugins designed specifically to clean the database. <a href=\"https:\/\/getwpo.com\/\" target=\"_new\" rel=\"noopener\">WP-Optimize<\/a> and <a href=\"https:\/\/sigmaplugin.com\/downloads\/wordpress-advanced-database-cleaner\" target=\"_new\" rel=\"noopener\">Advanced Database Cleaner<\/a> are among the most popular. These plugins allow you to select and clean specific database tables.<\/p>\n<p><strong>3. Direct SQL:<\/strong> If you\u2019re comfortable using SQL, you might consider running SQL queries directly on your database to clean the tables. A possible query to delete the completed tasks could be <code>DELETE FROM actionscheduler_actions WHERE status='complete';<\/code>. Remember, however, that this method should be used with extreme caution.<\/p>\n<h2>Conclusion on the Guide to Cleaning the Action Tables<\/h2>\n<p>Database optimisation is an essential component of maintaining a WordPress site. A <strong>regular database cleanup<\/strong> can free up a huge amount of storage space and improve your site\u2019s performance. Always remember to make a backup of your site and your database before proceeding with the cleaning and, if necessary, consult an expert to ensure that the changes don\u2019t affect the proper functioning of your site.<\/p>","protected":false},"excerpt":{"rendered":"<p>La manutenzione del tuo sito WordPress non si limita solo all&#8217;aggiornamento dei temi e dei plugin o alla creazione di nuovi contenuti. Un aspetto altrettanto&hellip;<\/p>","protected":false},"author":2,"featured_media":46911,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_seopress_titles_title":"Ottimizzare WordPress: Pulizia Tabelle Action Scheduler","_seopress_titles_desc":"Scopri come migliorare le prestazioni di WordPress pulendo le tabelle actionscheduler_actions e actionscheduler_logs grazie alla nostra guida dettagliata.","_seopress_robots_index":"","_seopress_robots_follow":"","_seopress_robots_imageindex":"","_seopress_robots_snippet":"","_seopress_robots_primary_cat":"0","_seopress_robots_breadcrumbs":"","_seopress_robots_freeze_modified_date":"","_seopress_robots_custom_modified_date":"","_seopress_robots_canonical":"","_seopress_social_fb_title":"","_seopress_social_fb_desc":"","_seopress_social_fb_img":"","_seopress_social_fb_img_attachment_id":0,"_seopress_social_fb_img_width":0,"_seopress_social_fb_img_height":0,"_seopress_social_twitter_title":"","_seopress_social_twitter_desc":"","_seopress_social_twitter_img":"","_seopress_social_twitter_img_attachment_id":0,"_seopress_social_twitter_img_width":0,"_seopress_social_twitter_img_height":0,"_seopress_redirections_value":"","_seopress_redirections_enabled":"","_seopress_redirections_enabled_regex":"","_seopress_redirections_logged_status":"both","_seopress_redirections_param":"","_seopress_redirections_type":301,"_seopress_analysis_target_kw":"pulizia database WordPress,ottimizzazione WordPress,pulizia tabelle WordPress,prestazioni WordPress,Action Scheduler,WP-CLI,pulizia database","_seopress_news_disabled":"","_seopress_video_disabled":"","_seopress_video":[],"_seopress_pro_schemas_manual":[],"_seopress_pro_rich_snippets_disable_all":"","_seopress_pro_rich_snippets_disable":[],"_seopress_pro_schemas":[],"footnotes":""},"categories":[61],"tags":[1327,556,800,492],"class_list":["post-46908","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","tag-backup","tag-guida","tag-ottimizzazione-wordpress","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/gtechgroup.it\/blog\/en\/wp-json\/wp\/v2\/posts\/46908","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gtechgroup.it\/blog\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gtechgroup.it\/blog\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gtechgroup.it\/blog\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/gtechgroup.it\/blog\/en\/wp-json\/wp\/v2\/comments?post=46908"}],"version-history":[{"count":0,"href":"https:\/\/gtechgroup.it\/blog\/en\/wp-json\/wp\/v2\/posts\/46908\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gtechgroup.it\/blog\/en\/wp-json\/wp\/v2\/media\/46911"}],"wp:attachment":[{"href":"https:\/\/gtechgroup.it\/blog\/en\/wp-json\/wp\/v2\/media?parent=46908"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gtechgroup.it\/blog\/en\/wp-json\/wp\/v2\/categories?post=46908"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gtechgroup.it\/blog\/en\/wp-json\/wp\/v2\/tags?post=46908"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}