Hi @owengna,
Unfortunately, there’s not much we can do about this as it’s recommended to clear the cache once something gets updated. Otherwise, you could receive old data when querying meta information.
Best regards,
But how about optimising the loading query?
I checked the query monitor and noticed that all pages load all custom meta box data even though they are not needed for the current page.
For example, I set up a custom meta box with data for a custom post type “Book”. I can see the custom meta box for “Book” is loaded with “update_meta_cache” on a normal page.
Hi @owengna,
You can try using the following custom code to see if it helps:
add_filter('init', 'wckc_remove_serialized_update');
function wckc_remove_serialized_update(){
remove_filter( "get_post_metadata", 'wck_serialized_update_from_unserialized', 10, 4 );
}
You can use the code by adding it to your theme’s ‘functions.php’ file or by creating a new plugin as described here.
Best regards,