I converted all my tables to InnoDB, but the MySQL server (which I can’t access, as I’m on shared hosting) has MyISAM as the default, so every new table that WordPress creates (e.g. when I add a new site on my multisite) uses the MyISAM engine and I have to alter it manually. Can I somehow set WordPress up to enforce the InnoDB engine when creating new tables?
I know that by default WordPress doesn’t specify anything and lets the table use the default engine, but I’m wondering if there is some plugin where I could add the
ENGINE=InnoDB
clause to all the CREATE TABLE
queries.
If the code creating new tables uses
dbDelta()
(it should), you can filter the query (seewp-admin/includes/upgrade.php
):