Is It A Good Idea To Change Author Slug (user_nicename field) Directly In MySQL DB?

Providing you know what you’re doing that shouldn’t be a problem. You will however have to check that any author/user pages you may have are linked by id rather than name in the code:

$data = get_userdata( $userid );

As opposed to

$data = get_userdata('Admin');

Because the ID will never change (unless you delete the row and re-insert) but if you change Admin to Supreme Overlord, Master of this Domain the second reference will not work but the first will.

NOTE, this will not break the usage of current_user_can($capability) but will break user_can('Admin',$capability) but I don’t see why you would be using user_can() over current_user_can() anyways.

Leave a Comment