If my theme has a lot of options is it better to store all options in one database entry, or to use a databse entry for each group of options? IE would I name all options like this themeSlug[optionType_specificOption]
or like this: themeSlug_optionType[specificOption]
?In the latter example if I need the settings for my post slider I would do $sliderOptions = get_option('themeSlug_slider');
.
I guess my question is do I see any performance benefit to making several smaller queries vs one large query for my options? Are their any other advantages/disadvantages to grouping my options into different entries?
All options with
autoload = yes
(default) are fetched very early in one query. So the number of options does affect performance only marginally.Split options if you donât need everything on every page load. With â¦
⦠you can set options that arenât loaded before you actually call
get_option()
.