Title: Multisite support
Last modified: March 12, 2021

---

# Multisite support

 *  [tfr79](https://wordpress.org/support/users/tfr79/)
 * (@tfr79)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/multisite-support-358/)
 * Hello everyone,
    at first: thanks for this simple and yet very useful plugin.
   My question is: For your next release, could you maybe add the blog_id or something
   to the filename where the variables are stored? Then the plugin would be able
   to be used in multisite installations. Unfortunately there is no way to contribute
   code yet…
 * Best regards!

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [akirak](https://wordpress.org/support/users/akirak/)
 * (@akirak)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/multisite-support-358/#post-14173520)
 * Hi [@tfr79](https://wordpress.org/support/users/tfr79/) ,
 * Thanks for the idea!
    Though I was wondering what exactly you would like to accomplish
   by this or what problem you are having now. Using different values for the same
   key between sites is a use case that I can think of. Hearing your use cases will
   give me better idea for the requirements.
 * Akira
 *  Thread Starter [tfr79](https://wordpress.org/support/users/tfr79/)
 * (@tfr79)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/multisite-support-358/#post-14173781)
 * Hi [@akirak](https://wordpress.org/support/users/akirak/), when we use your plugin
   on different websites of a multisite WP installation, all sites read the cgv 
   values from the same database file. So if I define a cgv variable like “super_secret”
   = 12345 on one of the websites, this variable is immediately visible on any other
   website of the multisite network as soon as the cgv plugin is activated on that
   other site. And thus any change to the value affects any usages within the multisite
   network.
 * In concrete we have prices with the same name but with a value that differs slightly
   between different websites of the network. This is currently not possible with
   cgv.
 * One might rather want to keep those variables private for a single website inside
   the network. So my suggestion is to add sth. like get_current_blog_id() to the
   filename in order to keep cgv values separated from different blogs.
    -  This reply was modified 5 years, 2 months ago by [tfr79](https://wordpress.org/support/users/tfr79/).
 *  Plugin Author [akirak](https://wordpress.org/support/users/akirak/)
 * (@akirak)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/multisite-support-358/#post-14173903)
 * Thank you for sharing your use cases, [@tfr79](https://wordpress.org/support/users/tfr79/).
   
   I agree it’s better to provide multisite functionality which can override a value
   for any single multisite. It’s not a quick development so I’m not sure I can 
   give you timeline. Or if you can contribute code, that would be good starting
   point for me..
 * One thing I want to emphasize is that you shouldn’t put any secret info in this
   plugin’s config.
    As you see the code, the variables are not stored in DB and
   it can be viewed if the hash name is guessed properly.
 *  Thread Starter [tfr79](https://wordpress.org/support/users/tfr79/)
 * (@tfr79)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/multisite-support-358/#post-14174126)
 * Thanks for your time sharing your thoughts on this [@akirak](https://wordpress.org/support/users/akirak/)–
   from my knowledge you would just have to change line 19 to sth. this:
    `$this-
   >file_path = WP_CONTENT_DIR . '/custom-global-variables/' . md5( AUTH_KEY ) .(
   is_multisite() ? ('-'. get_current_blog_id()) : '') . '.json';`
 *  Plugin Author [akirak](https://wordpress.org/support/users/akirak/)
 * (@akirak)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/multisite-support-358/#post-14184488)
 * Thanks for the code, [@tfr79](https://wordpress.org/support/users/tfr79/) .
    
   I am thinking of providing a set of variables for all sites and sets for individual
   sites. The current implementation will stay as is, to cover a set for all sites.
   This way, we can make sure not to cause any regressions for existing installation
   and individual site can override base value for certain key. I will let you know
   when this is available but it will take some time.
 *  [aaronbiby](https://wordpress.org/support/users/aaronbiby/)
 * (@aaronbiby)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/multisite-support-358/#post-14388610)
 * I would love to have this functionality too! I was going to use the variables
   in my child sites as well.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Multisite support’ is closed to new replies.

 * ![](https://ps.w.org/custom-global-variables/assets/icon-256x256.png?rev=1415125)
 * [Custom Global Variables](https://wordpress.org/plugins/custom-global-variables/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-global-variables/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-global-variables/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-global-variables/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-global-variables/reviews/)

## Tags

 * [multisite](https://wordpress.org/support/topic-tag/multisite/)

 * 6 replies
 * 3 participants
 * Last reply from: [aaronbiby](https://wordpress.org/support/users/aaronbiby/)
 * Last activity: [5 years, 1 month ago](https://wordpress.org/support/topic/multisite-support-358/#post-14388610)
 * Status: not resolved