One of those days where you appreciate the little things. Today, I changed the admin username in WordPress for a client. In a standard WordPress installation, this is quite straightforward. You simply update the USER_LOGIN and USER_NICENAME fields in the WP_USER table with the new name.
However, in a WordPress Multisite installation, you need to modify an additional table. In the WP_SITEMETA table, look for the entries with the key “ site_admin” under the column “ META_KEY” .
a:1:{i:0; s:6:"adminname"; }
But that’s not all! A small detail that cost me quite some time today: The value S: represents the length of the name and must be adjusted accordingly. Only then will you have full Super Admin rights and be recognized as the network administrator.
a:1:{i:0; s:9:"adminname"; }
In case anyone needs it, here are the other parameters:
a: → Length of the array
i: → Index number for each field