I have a network with more than 50 sites. I want to create one contact form (which means one shortcode) using contact form 7 or fast secure contact form. Then, I want to use that shortcode on all the 50+ sites so all sites use the same form.

The problem is that when I try to use a shortcode of site A over site B, it's not working.

Do you know how can I use a contact form shortcode globaly on all sites at once?



A Must Use plugin could do the work.

This is just an outline and has to be fully tested:

add_shortcode( 'global_form', 'shortcode_wpse_87634' );

function shortcode_wpse_87634() 
    // Main site, ID=1, that has the form
    switch_to_blog( 1 );

    // Do your stuff
    $my_stuff = something(); // maybe do_shortcode

    // Back to original site

    // Return shortcode content
    return $my_stuff;

Also, maybe the contact form plugin must be Network activated for this to work.
Having the shortcode available Network-wide will work with the mu-plugin, but to have the form really working globally, that's another issue.

| improve this answer | |
  • 1
    something new on this? I'm using Contact Form 7 in Multisite.. shortcode is working (form is showing) but there seem to be ajax errors... – KaFu Jun 21 '17 at 12:25

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