Home › Forums › ASE Support › Serialized data in postmeta – how to remove
Tagged: aesop_component, postmeta, serialized_data
- This topic has 3 replies, 2 voices, and was last updated 1 year, 10 months ago by
dutchie.
-
AuthorPosts
-
Participant
Hi,</p>
<p>I decided to stop using your plug-in and, while removing it from my install I found, for every image on the site, serialized data referring to the image size foraesop_component
left behind in thewp_postmeta
table. My site has a lot of images, so I’d like to shrink that table by removing this Aesop data.</p>
<p>But how do I go about that? I know there are search&replace tools that can work with serialized data, but I don’t want to replace the data, I want to remove it. Besides that, e each entry is of course different, so serach&replace would not even work… Going through over two thousand images manually is not an idea that I look forward to, one typo and I’m left with corrupted postmeta. </p>
<p>Please advise.KeymasterHi I can’t tell you 100% sure without looking at your table entries, but those metadata you see may not have been created _directly_ by ASE, but rather indirectly by the WordPress code itself. So it’s possible other themes or plugins you use may bring back those metadata. It’s also questionable how much benefit you will gain by removing those entries. The amount of space you save would not be that significant compared to the image data themseleves. (Where each image take up hundreds of KB if not MBs, whereas an entry in DB may take up a few dozen bytes if even that.) Also when you have more entries in DB it doesn’t affect search time that much either.
Given that, it should be very possible to remove specific columns or matching data using some SQL or PHP codes. (You can use WP functions such as delete_post_meta or use SQL statments such as DELETE) If you can show me a few rows of wp_postmeta table I can give you suggestions. But bear in mind that changing DB using this kind of method is a very dangerous operation. I can’t take any responsibility whatsoever. Before you do anything you should back up your DB first.
-
This reply was modified 1 year, 10 months ago by
Hyun Supul.
ParticipantHi Hyun,
I agree with you that the data seems quite insignificant, but if we leave all seemingly insignificant data left behind by plug-ins as well as WordPress itself… Well, it grows and eventually will slow down queries:-)
As for
delete_post_meta
, I’m not sure that would be possible, because the aesop reference is only part of the largermeta_value
.Anyway, here is one
meta_value
for you to wrap your head around, thanks!a:5:{s:5:"width";i:1325;s:6:"height";i:2000;s:4:"file";s:20:"2014/07/DSC84661.jpg";s:5:"sizes";a:11:{s:15:"aesop-component";a:4:{s:4:"file";s:22:"DSC84661-1250x1887.jpg";s:5:"width";i:1250;s:6:"height";i:1887;s:9:"mime-type";s:10:"image/jpeg";}s:9:"thumbnail";a:4:{s:4:"file";s:20:"DSC84661-180x180.jpg";s:5:"width";i:180;s:6:"height";i:180;s:9:"mime-type";s:10:"image/jpeg";}s:6:"medium";a:4:{s:4:"file";s:20:"DSC84661-398x600.jpg";s:5:"width";i:398;s:6:"height";i:600;s:9:"mime-type";s:10:"image/jpeg";}s:12:"medium_large";a:4:{s:4:"file";s:21:"DSC84661-768x1159.jpg";s:5:"width";i:768;s:6:"height";i:1159;s:9:"mime-type";s:10:"image/jpeg";}s:5:"large";a:4:{s:4:"file";s:22:"DSC84661-1325x2000.jpg";s:5:"width";i:1325;s:6:"height";i:2000;s:9:"mime-type";s:10:"image/jpeg";}s:14:"post-thumbnail";a:4:{s:4:"file";s:21:"DSC84661-1148x574.jpg";s:5:"width";i:1148;s:6:"height";i:574;s:9:"mime-type";s:10:"image/jpeg";}s:19:"fotografie-featured";a:4:{s:4:"file";s:20:"DSC84661-533x533.jpg";s:5:"width";i:533;s:6:"height";i:533;s:9:"mime-type";s:10:"image/jpeg";}s:25:"fotografie-featured-fluid";a:4:{s:4:"file";s:20:"DSC84661-640x640.jpg";s:5:"width";i:640;s:6:"height";i:640;s:9:"mime-type";s:10:"image/jpeg";}s:17:"fotografie-slider";a:4:{s:4:"file";s:22:"DSC84661-1325x1080.jpg";s:5:"width";i:1325;s:6:"height";i:1080;s:9:"mime-type";s:10:"image/jpeg";}s:21:"fotografie-hero-image";a:4:{s:4:"file";s:20:"DSC84661-864x864.jpg";s:5:"width";i:864;s:6:"height";i:864;s:9:"mime-type";s:10:"image/jpeg";}s:29:"jetpack-portfolio-admin-thumb";a:4:{s:4:"file";s:18:"DSC84661-50x50.jpg";s:5:"width";i:50;s:6:"height";i:50;s:9:"mime-type";s:10:"image/jpeg";}}s:10:"image_meta";a:12:{s:8:"aperture";s:3:"7.1";s:6:"credit";s:0:"";s:6:"camera";s:11:"NIKON D7000";s:7:"caption";s:0:"";s:17:"created_timestamp";s:10:"1391965555";s:9:"copyright";s:27:"© 2014, Ron van Middendorp";s:12:"focal_length";s:2:"17";s:3:"iso";s:3:"500";s:13:"shutter_speed";s:5:"0.002";s:5:"title";s:0:"";s:11:"orientation";s:1:"0";s:8:"keywords";a:0:{}}}
-
This reply was modified 1 year, 10 months ago by
-
AuthorPosts