differences between behavior get_option vs get_site_option in multisite

Yes, get_site_option() is for data about the whole network.

The irritation comes from a mixed vocabulary: what was a site once is a network nowadays, and what was a blog once is now a site in a network.

wp_get_sites() for example is from version 3.7, it fetches sites in a network, not all networks in an installation. So a site in wp_get_sites() is not the same as a site in get_site_option().

For plugin that should be used in a single-site installation or as network plugins only, you can always use get_site_option(), because on a single site it will fall back to get_option().

One important difference is: normal options are loaded automatically on every requests, so you will hit the cache with get_option(). Site options are not loaded automatically, only some core options. See /wp-includes/option.php wp_load_core_site_options().

To store information for all sites in all networks you have to use a custom table or pick one network in the current installation.

Leave a Comment