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?

  • 1
    Should there be a good reason for this? Why do you have to convert? Commented Sep 28, 2016 at 5:58
  • Gravity forms is powerful, but do you need it? If you do, maybe your system should support it. Commented Sep 28, 2016 at 6:01
  • bumping this. I have the same problem. My local machine has a higher version of MySQL. I used to be able to do a sync of DB to deploy my sites. Now because of the different collation, I can't sync anymore. This is a huuuugge problem.
    – resting
    Commented Oct 5, 2016 at 2:51
  • I have the same issue while developing locally. Pushing up to my live database is always a pain because it never likes that collation.
    – Tex0gen
    Commented Nov 1, 2016 at 10:41
  • If this is an issue specific to the plugin, then you should open up a ticket on the WordPress.Org page for the plugin.
    – Cedon
    Commented Mar 19, 2017 at 19:21

2 Answers 2


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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