1

We are using Metatag 7.x-1.7. Our current metatag table is 1.6 GB's. I'm trying to reduce this table significantly. I've looked for solutions that may have already been brought up for size reduction but could not find any.

Looking at the structure of the data column shows me an extreme amount of redundancy. It is literally all the exact same thing for the "file" entity_type

a:117:{s:5:"title";a:2:{s:5:"value";s:34:"[current-page:title] | [site:name]";s:7:"default";s:34:"[current-page:title] | [site:name]";}s:11:"description";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:8:"abstract";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:8:"keywords";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:6:"robots";a:2:{s:5:"value";a:10:{s:5:"index";i:0;s:6:"follow";i:0;s:7:"noindex";i:0;s:8:"nofollow";i:0;s:9:"noarchive";i:0;s:9:"nosnippet";i:0;s:5:"noodp";i:0;s:6:"noydir";i:0;s:12:"noimageindex";i:0;s:11:"notranslate";i:0;}s:7:"default";a:10:{s:5:"index";i:0;s:6:"follow";i:0;s:7:"noindex";i:0;s:8:"nofollow";i:0;s:9:"noarchive";i:0;s:9:"nosnippet";i:0;s:5:"noodp";i:0;s:6:"noydir";i:0;s:12:"noimageindex";i:0;s:11:"notranslate";i:0;}}s:13:"news_keywords";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:8:"standout";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:6:"rating";a:1:{s:5:"value";s:0:"";}s:8:"referrer";a:1:{s:5:"value";s:0:"";}s:6:"rights";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:9:"image_src";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:9:"canonical";a:2:{s:5:"value";s:28:"[current-page:canonical-url]";s:7:"default";s:28:"[current-page:canonical-url]";}s:9:"shortlink";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:9:"publisher";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:6:"author";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:15:"original-source";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:4:"prev";a:1:{s:5:"value";s:0:"";}s:4:"next";a:1:{s:5:"value";s:0:"";}s:13:"revisit-after";a:3:{s:5:"value";s:0:"";s:6:"period";s:0:"";s:7:"default";s:0:"";}s:16:"content-language";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:12:"geo.position";a:1:{s:5:"value";s:0:"";}s:13:"geo.placename";a:1:{s:5:"value";s:0:"";}s:10:"geo.region";a:1:{s:5:"value";s:0:"";}s:4:"icbm";a:1:{s:5:"value";s:0:"";}s:7:"refresh";a:1:{s:5:"value";s:0:"";}s:7:"og:type";a:2:{s:5:"value";s:7:"article";s:7:"default";s:7:"article";}s:6:"og:url";a:2:{s:5:"value";s:28:"[current-page:canonical-url]";s:7:"default";s:28:"[current-page:canonical-url]";}s:8:"og:title";a:2:{s:5:"value";s:20:"[current-page:title]";s:7:"default";s:20:"[current-page:title]";}s:13:"og:determiner";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:14:"og:description";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:15:"og:updated_time";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:11:"og:see_also";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:8:"og:image";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:12:"og:image:url";a:1:{s:5:"value";s:0:"";}s:19:"og:image:secure_url";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:13:"og:image:type";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:14:"og:image:width";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:15:"og:image:height";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:11:"og:latitude";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:12:"og:longitude";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:17:"og:street_address";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:11:"og:locality";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:9:"og:region";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:14:"og:postal_code";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:15:"og:country_name";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:8:"og:email";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:15:"og:phone_number";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:13:"og:fax_number";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:9:"og:locale";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:19:"og:locale:alternate";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:14:"article:author";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:17:"article:publisher";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:15:"article:section";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:11:"article:tag";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:22:"article:published_time";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:21:"article:modified_time";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:23:"article:expiration_time";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:18:"profile:first_name";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:17:"profile:last_name";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:16:"profile:username";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:14:"profile:gender";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:8:"og:audio";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:19:"og:audio:secure_url";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:13:"og:audio:type";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:11:"book:author";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:9:"book:isbn";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:17:"book:release_date";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:8:"book:tag";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:8:"og:video";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:19:"og:video:secure_url";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:14:"og:video:width";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:15:"og:video:height";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:13:"og:video:type";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:11:"video:actor";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:16:"video:actor:role";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:14:"video:director";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:12:"video:writer";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:14:"video:duration";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:18:"video:release_date";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:9:"video:tag";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:12:"video:series";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:12:"twitter:card";a:2:{s:5:"value";s:7:"summary";s:7:"default";s:7:"summary";}s:15:"twitter:creator";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:18:"twitter:creator:id";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:11:"twitter:url";a:2:{s:5:"value";s:27:"[current-page:url:absolute]";s:7:"default";s:27:"[current-page:url:absolute]";}s:13:"twitter:title";a:2:{s:5:"value";s:20:"[current-page:title]";s:7:"default";s:20:"[current-page:title]";}s:19:"twitter:description";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:17:"twitter:image:src";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:19:"twitter:image:width";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:20:"twitter:image:height";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:14:"twitter:image0";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:14:"twitter:image1";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:14:"twitter:image2";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:14:"twitter:image3";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:14:"twitter:player";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:20:"twitter:player:width";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:21:"twitter:player:height";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:21:"twitter:player:stream";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:34:"twitter:player:stream:content_type";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:19:"twitter:app:country";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:23:"twitter:app:name:iphone";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:21:"twitter:app:id:iphone";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:22:"twitter:app:url:iphone";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:21:"twitter:app:name:ipad";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:19:"twitter:app:id:ipad";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:20:"twitter:app:url:ipad";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:27:"twitter:app:name:googleplay";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:25:"twitter:app:id:googleplay";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:26:"twitter:app:url:googleplay";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:14:"twitter:label1";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:13:"twitter:data1";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:14:"twitter:label2";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:13:"twitter:data2";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:20:"twitter:seeit:showid";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:21:"twitter:seeit:idspace";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:24:"twitter:seeit:campaignid";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}s:21:"twitter:seeit:assetid";a:2:{s:5:"value";s:0:"";s:7:"default";s:0:"";}}
  • Would the newest version (7.x-1.25) of the Metatag module fix this issue?
  • What options exist in reducing the redundant data structure caused by the metatag module for the file entity_type?
  • How would one approach creating a custom solution to this problem that wouldn't require a major overhaul of metatag's operations within Drupal?
  • 2
    Have you raised this as an issue on drupal.org? Seems like the sort of thing the module maintainer would have an opinion on. – Alfred Armstrong Oct 23 '18 at 11:36
  • a custom solution could be relying on a custom hook_metatag_presave(&$metatags, $entity_type, $entity_id, $revision_id, $langcode) implementation. The $entity_type argument will help filtering on file entity_type and then implement a custom logic to save or not the data. – izus Oct 25 '18 at 9:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.