BuddyDev

Do you want global Categories, tags or taxonomies across your WordPress Multisite network?

This plugin is deprecated and we do not recommend using it.

Do you want that all of your sites in the multisite network should have same categories, tags, terms? Today, In this tutorial, we are going to make all the terms available across all blogs of a multisite. Also, a terms ( category/tags ) can be added from any of the blog. Once It is added, It will be available across all the blogs.

Let us understand some basic terminologies first.

Taxonomy: – Taxonomy is a way to classify & group together the information. What it means in WordPress, Please take a look here to understand. For example "categories", "tags" are taxonomies which allow you to classify information( post ) in various categories/tags. In WordPress, categories, tags are inbult taxonomy while custom taxonomies can be added by using register_taxonomy as and when required.

Terms:- The name under which we group various posts etc is called term. For example, Let us say Travelling, News etc are terms where you file your posts.

How WordPress handles the taxonomies/terms on multisite:-

  • On multisite, all blogs share same database ( most of the time )
  • WordPress uses 3 tables for storing the taxonomy, terms and post to term association. These are wp_terms, wp_terms_taxonomy and wp_terms_relationships ( where wp_ is the prefix you specified at the time of installation, It may vary depending on your installation)
  • wp_terms table is used to store the actual terms ( The categories like "Awesome Food"). It contains term id, name, slug and term_group
  • wp_terms_taxonomy table is used to contain information about which terms belongs to which taxonomy.
  • wp_terms_relationships table is used to associate the terms to individual posts( or post type ).
  • Each of the blog on multisite has their own copy of these three tables.

So, all we need to do is make sure that the wp_terms & wp_terms_taxonomy table is shared across the multisite and not used per site basis. The simplest way to this is to change the property of $wpdb object as shown below. You can put the code inside mu-plugins directory.

Now, The terms and terms_taxonomy table of the main site is shared  with all the blogs, so all the terms from main site will appear everywhere. Also, If a new term is added from any of the blog, It will appear on all other sites.

Issues:-

  • If there are existing terms on sub blogs which are not on the main site. They will be lost.
  • If you are using custom taxonomies, the terms belonging to custom taxonomies will be only available if the taxonomy is registered on the sub site( on which you want to access it )

If you need it as a plugin, Here I have put it as a plugin:-

Download:-

https://buddydev.com/plugins/mu-global-terms/

The plugin must be network activated.

PS: We are in the process of updating our old plugins and putting some new as promised in the previous post. Please do let us know your ideas/suggestions in the comment below.

13 Responses to Do you want global Categories, tags or taxonomies across your WordPress Multisite network?

  • Hi Brajesh,
    Nice tutorial as always. For some reason the link to the plugin is given a 404 page not found just so you know. Thanks again!

  • how can i change the plugin to work only with global tags?

    • Hi Asaf,
      that is not possible with this plugin. It allows all terms to be global and does not allow to filter out specific taxonomies.

  • There is a huge problem with this approach. It Shares the menus (but not the terms) across all sites. And can be a problema with each site has it own Menu and can be very annoying if eanch site has a particular menu with the same name.

    • Hi Nicholas,
      i am sorry I don't understand what you meant. It seems there are some confusion.

      the plugin shares terms across all blogs but not any menu? multiple blogs can have same terms, that is the goal of this plugin. Can you please clarify if it is not obvious?

  • If you use this plugin. All Sites will have the same menus.

    Try this: Use this plugin and create a new Menu on any site on the Network. All the sites on the network will have that menu and if you delete one menu on any site, it will delete on all sites.

    Sorry for my bad english

  • Every time I create new sub site on my my multi site it deleted all the categories and menu options from all sites including the main one is it conflicting with a plugin of mines or something I missing?

    • Hi Nelson,
      I am sorry for the trouble. I did not test it by creating new sites. I will do that and let you know today.

      • Well I got the problem resolved shortly after, I figured in case anybody else runs into this issue, Chances are we are using similar plugins (because of mulitsite). Global Taxonomies was conflicting with the plugin
        'New Blog Defaults' , as long as you do not set a default a 'template' in the plugin field the taxonomies carry over and no more vanishing menus =)

  • I have a problem : i have some custom taxonomies with parent structure :

    – Custom tax 1
    – sub tax 1
    – sub tax 2
    – Custom tax 2

    it works on blog id 1, but on the other blogs i see the sub taxs when i create/modify a post but not entering in the custom taxonomy list page in the backend. It works only for first level???

    • Hi Daniele,
      I am sorry I missed your reply.

      The taxonomies should be registered on all sites if you want them to be available everywhere.

      Thank you
      Brajesh