How can I redefine WordPress wp-content directory programmatically?

wp-config.php changes are persistent and should not be overwritten by updates.

Of course, there are ways to write to this file programmatically – which you could no doubt do from a plugin, but that’s really not the intended use – it’s designed more or less to hold settings which change very infrequently.

Perhaps you also need to edit another constant to get this working correctly, but I’m not certain this is required:

define('WP_CONTENT_FOLDERNAME', 'Folder_Name');
define('WP_CONTENT_DIR', ABSPATH . WP_CONTENT_FOLDERNAME);

Note that you OS might also by case sensitive, or not..