Use a separate custom table (not posts) to handle file upload data

The Problem:
Website that has over 100 photos per post. Could possibly swell posts-table beyond 100K entries within a few years.

The Dilemma:
Would much rather stick to default WP UI for handling images/files with the built-in “Add Media” Uploader. I’d like to avoid using a separate File Gallery implementation if possible.

The Question:
Has anyone found a way to divert the saving of data away from the posts_table and to your own custom table to store the file-data? (without having to hack core files)

5 s
5

Perhaps there’s a manageable way to shift the images from being store as attachments (aka posts) to being stored in an array that’s kept at the parent post level. I think it’s going to depend on how much you need to manipulate the images, delete them, etc.

Shifting to another table might help but it would seem to me you might be robbing Peter to pay Paul. Sure bigger tables hurt but if those rows are somewhere else and you still need a join, etc. how much is going to be saved? I think you might have to get a bit more outside the box to crack this nut.

Leave a Comment