How to stop WordPress using utf8mb4_unicode_520_ci collation?

Recently I've installed PHP7 on my MAMP and updated to newest version of WordPress. Every time I do a new site all my tables are using collation utf8mb4_unicode_520_ci

I have tried setting define('DB_COLLATE', 'utf8_general_ci'); in my wp-config.php which worked fine until Gravity Forms ignored it and created all it's tables in utf8mb4_unicode_520_ci

I've seen that if utf8mb4_unicode_520_ci is available it will use that so is there a surefire way to stop WP using that collation? Can I just remove that collation as I am having to run 10 ALTER TABLE queries before I can port the database over to staging/live server?

Topic collation database Wordpress encoding

Category Web


Not using utf8mb4_unicode.... collation and using a utf8 one instead is a security problem. The right answer is to upgrade your sites and DBs so they all use utf8mb4


I ran into a similar issue while deploying sites using BackupBuddy. Ninja Forms was constantly creating tables in unicode_520_ci, no matter what settings I used in Sequel Pro.

Not sure if this helps or not, but all I had to do was change the collation within Sequel Pro for the specific Ninja Forms tables, and then the deployment would work as normal.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.