WP-Config.php Character Fix - Breaks MU Site Creation

Hello,

My blog was struck with the strange characters on my homepage and through my posts...

Most just strange  characters. I found the solution many found that worked by adding this line of code to my wp-config.php

('DB_CHARSET', 'utf8_unicode_ci');

That fixed the strange characters, but then prevents you from creating a new MU site.

When that fix is applied, if you try and create a new site it creates the site in your WPMU backoffice but when you visit the site it is just a blank page....

My WP-Config.php is below.

<?php

// ** MySQL settings ** //

define ( 'DB_NAME' , 'bchunt_wrdp1' ) ; // The name of the database
define ( 'DB_USER' , 'bchunt_wrdp1' ) ; // Your MySQL username
define ( 'DB_PASSWORD' , '**********' ) ; // ...and password
define ( 'DB_HOST' , 'localhost' ) ; // 99% chance you won't need to change this value

// Change the prefix if you want to have multiple blogs in a single database.
$table_prefix = 'wp_'; // example: 'wp_' or 'b2' or 'mylogin_'

// Change this to localize WordPress. A corresponding MO file for the
// chosen language must be installed to wp-includes/languages.
// For example, install de.mo to wp-includes/languages and set WPLANG to 'de'
// to enable German language support.

define ('WPLANG', '');
define('WP_ALLOW_MULTISITE', true);
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', true );
$base = '/';
define( 'DOMAIN_CURRENT_SITE', 'www.bchuntingblog.com' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
define( 'AUTH_KEY', '4.UAunG88OKN&K~ZY~V;y)L;2gnvKC8 2<~Y!P{V?Z%hj:lVR~y|X#kQl,d=>wZ5' );
define( 'SECURE_AUTH_KEY', 'BZ^[H ~?^sdVB7|~,k7m%{BbC.N=5]k6}fXrNB//h$[oR{Raj9,zI]0+zc9ZCo}' );
define( 'LOGGED_IN_KEY', 'xC]qG]IK).j5QxML+Z^:p1|-@LJyFMf{!?u]ig-^=F;s_00F%.kI4ti,;F2plaO-' );
define( 'NONCE_KEY', ');r[P_7[.{[tmV6~^I3;54bT!oyB ?KK:!!R{Q>!|N+:`infSL6Z.=%C2Ji|<uKn' );
define( 'AUTH_SALT', 'PiMUIRD}/a~&or~~v1On SUg]2;?Xy(*}e*GyVLv@ri+$M4TM_o(I/%j=&&S9fri' );
define( 'SECURE_AUTH_SALT', '>+Sw^=NO+K$>eqnl2C{2m_WR]&KD[0AvNt_+?M~J0Ii4Wj(z)M4Q;Hp;4clO]# k' );
define( 'LOGGED_IN_SALT', 'g[<&l%E8-/6;_~eOadK*R]|6_ otBSDBs:ZI*=]+voG5<&RYT;4wlRQ:$yLeoO.x' );
define( 'NONCE_SALT', '8}Imew}Gu[*- K>/{0gSJS ([]3yc|*uN|g@PBgU$LWr1#>A(3|-=)t#@SuBLL!z' );
/* Stop editing */

define('ABSPATH', dirname(__FILE__).'/');
require_once(ABSPATH.'wp-settings.php');

  • carlsor
    • New Recruit

    Sorry,

    Yes I did wrap it with define define('DB_CHARSET', 'utf8_unicode_ci);

    I added it above this line

    // Change this to localize WordPress. A corresponding MO file for the
    // chosen language must be installed to wp-includes/languages.
    // For example, install de.mo to wp-includes/languages and set WPLANG to 'de'
    // to enable German language support.

    define('DB_CHARSET', 'utf8_unicode_ci);
    define ('WPLANG', '');
    define('WP_ALLOW_MULTISITE', true);

    It fixed the character problem, but then when trying to create a new site through Super Admin it's just a blank site... no content at all, cannot even get to the sub-sites control panel.

    I am not sure how to tell if my database is using the same collation?

    Carl

  • drmike
    • DEV MAN’s Mascot

    Anytime you start messing with database settings, please make sure you do a backup of your database first. It's too easy to screw something up.

    Chances are, as dronix notes, the databases are not set to utf8. If you;re on CPanel, that defaults them to latin1. The messed up A's are a good sign of that. In fact we just had this discussion a few days ago.

    Discussed here: https://premium.wpmudev.org/forums/topic/add-disk-space-quota-mannualy

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.