0

I just did this and I couldn't find any documentation so I thought I'd post instructions in case anyone else wants to migrate the Custom Field Template to a Multisite.

In my case I was migrating from a pay for WPML multilingual website to a core Wordpress Multisite with each language configured as a separate site in subfolders as below. I chose subfolders but I imagine this will work for subdomains too.

www.mysite.com/
www.mysite.com/de/
www.mysite.com/fr/

Once you have your Wordpress Multisite set up with more than one site and the Custom Field Template installed in the Network Admin Dashboard go to...

My Sites > Network Admin > Plugins

...and enable the Custom Field Template plugin. There are no settings here, you configure the settings in each site.

Next go to your primary site dashboard, in my case www.mysite.com, and in the Plugins section you will see that the Custom Field Template plugin is enabled. Now go to...

Settings > Custom Field Template

...and all your custom fields should be there. However if you go to the custom field template settings in one of your other sites you should see a php error message (sorry, I didn't write it down) and your custom field settings are not shown. The restoration is really easy, back in your primary site scroll to the bottom of your Custom Field Template settings and you will see an Export Options button. Select this and save the file anywhere you like.

Now go to the same location in one of your sites where the fields are not showing and scroll to the bottom until you see Import Options. Import the file you exported a moment ago.

Refresh your browser window and the custom fields settings should now be visible for this site too. Import the same file into any other sites in which custom field settings are not visible.

Really easy once you know how but I couldn't see any documentation and found it by chance.

2
  • I found the php error message generated by Custom Field Template mentioned above, it is Warning: count(): Parameter must be an array or an object that implements Countable Commented Mar 17, 2018 at 18:18
  • Update -- I discovered that error message occurs if you add a drop down menu as an option to your custom posts but don't choose a value in the post. The error message is therefore no longer relevant to this question and should be ignored. Commented Mar 19, 2018 at 15:26

1 Answer 1

1

You will need to find a way to do import Options programmatically, by hooking wpmu_new_blog.
the hook function should switch_to_blog do your Import Options and restore_current_blog.

1
  • Thanks, I'm guessing that will keep the custom fields synchronised between sites. Commented Mar 17, 2018 at 18:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.