• Finding the media library on one of our clients sites very slow, we noticed it reports about 850K items (!). I ran a query on the posts table for attachments and also got that number.

    Doing a count on the files in the uploads folder, we only get about 16K images.

    Digging a bit further, I found that the post_meta table is about 1.5GB in size.

    I’m making a couple of assumptions, but I think something is out of whack with the media records.

    Is there any way to test/index/fix this?

    Thanks.

    Simon

Viewing 2 replies - 1 through 2 (of 2 total)
  • It could be that there are a lot of post revisions taking up a lot of space there that could be safely removed. The WordPress codex has some information on controlling post revisions in the future (https://ww.wp.xz.cn/support/article/editing-wp-config-php/#post-revisions) but this doesn’t help with post revisions already created/stored. So the post revisions already made would still need to be adjusted. For that there are some free plugins that can help optimize the database and/or trim the post revisions.
    https://ww.wp.xz.cn/plugins/search.php?q=post+revisions

    It’s also possible that transients are being stored in the database. And in that case, you may want to try a plugin like WP Optimize to remove the transients and optimize the database.

    Thread Starter SeeThrough Web

    (@seethroughweb)

    Thank you.

    I’ve run through WP Optimize’s optimizations. Unfortunately there was no significant change.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Media Library issue’ is closed to new replies.