I would actually advise against doing that.
If you create a table for each blog on network activation you’ll start running into scalability issues. Some Multisite networks are small (2-10 sites) and wouldn’t cause too many issues. But larger networks (1000+ sites) would add a lot to the database if they added their plugin.
Instead, I’d recommend creating a single table and adding a “blog_ID” column to the table. If you’re running a single site installation, just set that column to be 0 and run everything normally. But on a Multisite installation, set that column to whatever blog is using that data.
A single table is easier to manage.
Besides, if you create a new table for each blog, not only do you need the massive creation script when first activating the plugin, but you need to hook into the site creation mechanism to create a new table whenever a site is created.
Related Posts:
- Delete tables from database when deleting plugin
- How to delete all records from or empty a custom database table?
- WordPress sharding: which multi-DB plugin to use?
- Simple form that saves to database
- Plugins or Tutorials for displaying data from SQL-db on WP-page? [closed]
- Using Vagrant for customizable WordPress Multi-sites [closed]
- How do I check what plugins are enabled via the database?
- Can I explicitly specify ENGINE=InnoDB in WordPress?
- How can a Firebase user registration and login be integrated into a WordPress site?
- Custom database or Custom Post Types?
- How to update widget_text in the wp_options table
- Get the last post ID
- How to count number of records found in a database table?
- prefix table and plugins
- how to show database content in wordpress post
- What is the easiest way to implement cascading database upgrade for my plugin?
- clean wp_options table unused rows
- Storing Email Account Passwords for SMTP Mailing for a WordPress Plugin
- Remove obsolete plugins artifacts from database tables
- If I delete plugins via FTP are settings kept in DB?
- How to write one comment and publish on every post using database or plugin?
- What kind of data is that?
- Cannot login to ADMIN even after changing password in phpmyadmin
- Where to hook my plugin’s action
- Embed a Google Sheet as you view it in a separate tab?
- Building an email signup form. Where should the information be saved in the DB?
- Where does WordPress store plugin (enabled/disabled) status for multisite?
- How to access data in wordpress database externally using php
- custom user tables supported in SharDB plugin?
- How to check if tables in WordPress still exists after activations
- Prevent duplicate records in plugin table
- Automatic switch to backup database on fail
- WordPress Integration with Google Groups
- Create a table with wordpress plugin boilerplate
- wp_editor content in plugin options page
- WordPress and a secondary database?
- Why this function not working for install database on plugin activation
- WordPress : Explain Plugins & Theme string value in database
- Is it necessary to auto delete my WP plugin database tables when users deactivate/delete my plugin?
- Plugins in WP_Options but not Active
- How do i edit the plugin files in DataBase via phpMyAdmin?
- WordPress as a data-store?
- How to insert and call new data in wordpress website database through a plugin
- Issue running db create table query from static method
- Problem of encoding characters (apostrophes) in my posts publications
- Separate database for a wordpress plugin
- Is there a rule for wordpress plugins developers to not do any database changes upon update?
- Updating options into the wp database performance
- Ajax save data to database on document ready, no data being saved
- How to do database for download stats?
- What is the WordPress approach to custom data?
- How retreive saved data from gravity forms in my template?
- External wpdb connections in different plugins on single page
- Comment “like” problem – “users who like this” avatar linking to current user profile instead of “liker’s” profile
- WordPress plugin boilerplate table create
- How to relate 3 wordpress components with each other (Create database relationships)
- Creating a search form and displaying results
- How can I store data from custom fields to custom tables?
- How to access the WordPress DB from a plugin file
- Integrating Custom Database with WordPress
- How to display results from a data table with an encrypted user id?
- add_action for publish_post doesn’t work
- Getting URL GET parameter with Code snippets and storing it in database?
- Same Plugin tables between wordpress installations
- Bulk Edit Media Library alt, caption, image names
- Cant create table on plugin activation
- Optimise wordpress database using SQL after deleting registered images from Media Folder
- How to implement data residency in my WordPress site
- Moving a few select DB tables to a new WP instance
- WordPress database problem wp_posts, primary key
- How to allow URL with filename & extension in wordpress?
- How wordpress handle urls present in db for external wp-content directory
- Using Filters to modify contect – DB query results alwats appear fist
- PHP message: WordPress database error Deadlock found when trying to get lock
- Many to many relationship for variable products
- Is it a good practice to use wordpress database to store pages contents which loading to page dynamically?
- using wordpress login details for other website / application / forum?
- Where do the section input fields values are stored in database
- how to create database to use it in wordpress website?
- How to create a custom page for unrelated database?
- User content database [closed]
- How to save information related to post in database?
- RSS Feed has no Items (Possible Plugins Conflict)
- A plugin is giving me “You do not have sufficient permissions to access this page.” error
- How to find an option in the database?
- wpdb get_var is not returning any result (verified mysql query returns only one value)
- Is there a plugin that will override the “Error establishing a database connection” message? [closed]
- Get the url of attachments from the post?
- Create New Admin Menu Section – Like how custom post type works, in a way
- Creating fields in the database
- Allow users to enter and edit data in one-to-many configuration
- Updating WordPress [closed]
- Shortcode returning specific content of a post
- get_option returning a different value from what’s saved
- How can I delete the options from DB when the plugin is deleted?
- Fragmented Static Conversion of WordPress Pages
- Form with response button after on table after submission
- plugin doesn’t retrieve data from database
- Can’t save formdata in DB
- How do I set WordPress to send 2 different emails based on criteria in the database when someone submits a form?