{"id":1463389,"date":"2018-02-25T18:12:07","date_gmt":"2018-02-26T02:12:07","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/featured-images-add-an-ever-increasing-burden-on-the-databases-postmeta-table\/"},"modified":"2018-02-26T08:45:43","modified_gmt":"2018-02-26T16:45:43","slug":"featured-images-add-an-ever-increasing-burden-on-the-databases-postmeta-table","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/featured-images-add-an-ever-increasing-burden-on-the-databases-postmeta-table\/","title":{"rendered":"&quot;Featured Images&quot; add an ever increasing burden on the database&#039;s postmeta table"},"content":{"rendered":"<p>Over time, each event added to a TEC Pro site that utilizes a featured image bloats the database to HUGE sizes.   Even if the image is only loaded into uploads once and used over and over again, it saves a new copy for every event that uses that image into the DB. As an example, we&#8217;ve run over 12,000 events with TEC Pro, each with an attached feature image that has resulted in a database with about 1 GiB of images.  This places an undue burden on the server, as it fills up the wp_postmeta table with a ton of sizable entries from expired events.<\/p>\n<p>This is a very important issue for power users of TEC Pro, as database maintenance is of primary concern to any wordpress user with a large site.<\/p>\n<p>For the short term, can Modern Tribe provide a SQL query that will delete all images saved in the database for expired events?<\/p>\n<p>For the long term, I think this should be dealt with as a maintenance plugin for TEC Pro to remove expired events and all related data from a user&#8217;s site. Ideally, I see it providing the following:<\/p>\n<p><strong>Delete all expired events based off a user defined setting <\/strong><br \/>\n1. All events, immediately upon expiration.<br \/>\n2. All events, at a user defined time period after expiration.<br \/>\n3. Events of selected categories, immediately upon expiration.<br \/>\n4. Events of selected categories, at a user defined time period after expiration.<\/p>\n<p><strong>When deleting events, the plugin should also delete any related postmeta data, including featured images, reviews, etc.<\/strong><\/p>\n<p>While I don&#8217;t think this plugin would be necessary for most users who just run a few events a month, for power users who run HUNDREDS of events every month, this is a priority need to keep our database size under control.<\/p>\n<p>Thanks for your time.<\/p>\n","protected":false},"template":"","class_list":["post-1463389","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>&quot;Featured Images&quot; add an ever increasing burden on the database&#039;s postmeta table -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/featured-images-add-an-ever-increasing-burden-on-the-databases-postmeta-table\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"&quot;Featured Images&quot; add an ever increasing burden on the database&#039;s postmeta table -\" \/>\n<meta property=\"og:description\" content=\"Over time, each event added to a TEC Pro site that utilizes a featured image bloats the database to HUGE sizes. Even if the image is only loaded into uploads once and used over and over again, it saves a new copy for every event that uses that image into the DB. As an example, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/featured-images-add-an-ever-increasing-burden-on-the-databases-postmeta-table\/\" \/>\n<meta property=\"article:modified_time\" content=\"2018-02-26T16:45:43+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/featured-images-add-an-ever-increasing-burden-on-the-databases-postmeta-table\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/featured-images-add-an-ever-increasing-burden-on-the-databases-postmeta-table\/\",\"name\":\"&quot;Featured Images&quot; add an ever increasing burden on the database&#039;s postmeta table -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2018-02-26T02:12:07+00:00\",\"dateModified\":\"2018-02-26T16:45:43+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/featured-images-add-an-ever-increasing-burden-on-the-databases-postmeta-table\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/featured-images-add-an-ever-increasing-burden-on-the-databases-postmeta-table\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/featured-images-add-an-ever-increasing-burden-on-the-databases-postmeta-table\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"&quot;Featured Images&quot; add an ever increasing burden on the database&#039;s postmeta table\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"&quot;Featured Images&quot; add an ever increasing burden on the database&#039;s postmeta table -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/featured-images-add-an-ever-increasing-burden-on-the-databases-postmeta-table\/","og_locale":"en_US","og_type":"article","og_title":"&quot;Featured Images&quot; add an ever increasing burden on the database&#039;s postmeta table -","og_description":"Over time, each event added to a TEC Pro site that utilizes a featured image bloats the database to HUGE sizes. Even if the image is only loaded into uploads once and used over and over again, it saves a new copy for every event that uses that image into the DB. As an example, [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/featured-images-add-an-ever-increasing-burden-on-the-databases-postmeta-table\/","article_modified_time":"2018-02-26T16:45:43+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/featured-images-add-an-ever-increasing-burden-on-the-databases-postmeta-table\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/featured-images-add-an-ever-increasing-burden-on-the-databases-postmeta-table\/","name":"&quot;Featured Images&quot; add an ever increasing burden on the database&#039;s postmeta table -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2018-02-26T02:12:07+00:00","dateModified":"2018-02-26T16:45:43+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/featured-images-add-an-ever-increasing-burden-on-the-databases-postmeta-table\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/featured-images-add-an-ever-increasing-burden-on-the-databases-postmeta-table\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/featured-images-add-an-ever-increasing-burden-on-the-databases-postmeta-table\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"&quot;Featured Images&quot; add an ever increasing burden on the database&#039;s postmeta table"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1463389","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1463389\/revisions"}],"predecessor-version":[{"id":1463880,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1463389\/revisions\/1463880"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1463389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}