46:1 Dealing with monster websites
In this series, Lee looks at a range of WordPress tools that can add value to both the development process and client interactions. For each episode, Lee will define a problem, discuss his agency’s solution, and share a use case.
Lee Matthew Jackson
WordPress websites with many custom fields associated to post types. This can lead to a bloated post_meta table and in turn slow queries and overall performance.
Lee’s agency uses is Metabox, to override the default WordPress behavior and store custom field data in single rows in custom tables.
Two use cases for this are an internal CRM with lots of data or a searchable directory with thousands of assets around the world.
- Meta Box – click here
- Hooktrun plugin – click here
- Pods plugin – click here
WordPress tools to try before you die.
[Coughs] Sorry about that. Time for the next tool.
Welcome to this mini series for the month of October 2022. Here I am, full of a sinus infection. But the great thing about podcasts is you cannot catch them or can you?
No, you actually can’t. Scientifically, I believe. Anyway, in this series we’re going to look at a range of WordPress tools that we use in our agency that add immense value both to the development process that’s internally, but equally to our clients that interact with the work that we do. So for each episode we will define the problem, we’ll unveil the solution and then we’ll share a use case. All of the links will be in the show notes of every single episode for you to go and find the tools that we recommend.
Unless otherwise stated, none of these are affiliates. We’re not trying to make a load of money out of you, so just enjoy and see if you like what we like. And if you don’t, that’s totally cool. Just head on over to the website and let us know what you would have used. In place of the problem that we’ve defined.
Today’s problem is a website that has a large number of post types and custom fields. So this is making queries ridiculously slow and cumbersome. And of course the database is getting larger and larger. If you’re not aware of how custom fields are stored in the WordPress database, they are actually stored as a line per field in a table called Post Meta. Each one of those are then related to the actual post.
So if you imagine you have 20 custom fields against a single post type, then for every single post there would be a post record in the post table and there would also be a further 20 records in post meta for each one of those custom fields. Then imagine if you had 100 records. You can imagine how big your database is going to get and potentially how slow. Querying all of this data is a solution for us is Meta Box Pro. This is a paid for extension to the existing free Meta Box plugin.
Meta Box itself allows us to create the post types and custom fields. But with Meta Box Pro we have the addition of being able to override the default behaviour of WordPress and store the custom field data in a single row in a custom table. That means each post type would have a custom table. And if there were 20 custom fields, each post would only take up one row of that custom table rather than 20. This is a far more efficient way to store data and there is some phenomenal documentation as well.
Over on metabox.io, there will be a link in the show notes that show you how to use this and how to call the data in your WordPress theme should you be doing some theming. We’ve had two specific use cases for overriding the default meta structure of WordPress. One case was for an internal CRM that had a huge data set. Another was for a searchable directory that allowed people to find the locations of specific assets around the world. And there were tens of thousands of these particular assets.
In both cases. We are under a complete strict NDA, so I can’t really say any more about that. But essentially these were very data heavy websites and we were able to provide a wonderful service by going beyond the default WordPress behaviour and using a custom table. A couple of honourable mentions would be Hookturn’s plugin for advanced custom fields that allows you to do the same thing, and also Pods, which is a free plugin on WordPress that does everything. I do believe they have a Pods pro.
I’m not sure what’s in that. So you can check out links to both of those honourable mentions in the show notes. Folks that wraps up this episode. What would you have done in our situation with a website that required lots of post types and custom fields? Let us know in the comments whether or not you agree with our choices or if you would have done something different.
Did you know that not only can you tell us in the comments, but you can tell us in person? Head on over to agencytransformation.live, because on November 10, 2022 that’s this year we are getting together for a two day in person event. Day one will be full conference style with incredible speakers, and Day two will be a mastermind together where we help you define those next small achievable actions to your agency’s success. Check it out over on agencytransformation.live.